Diferente pentru blog/metaprogramare-cu-template-uri intre reviziile #3 si #4

Nu exista diferente intre titluri.

Diferente intre continut:

template <int N>
struct PrimeErrors
{
    enum { Result = CompileTimeError<!IsPrime<N>::Result>::Cool + PrimeErrors<N-1>::Result };
    enum { Result = CompileTimeError<!IsPrime<N>::Result>::Cool +
                      PrimeErrors<N-1>::Result };
};
template <>
templates.cpp:25:   instantiated from 'PrimeErrors<5>'
...
templates.cpp:34:   instantiated from here
templates.cpp:25: error: 'Cool' is not a member of 'CompileTimeError<false>'
templates.cpp:25: error: 'Cool' is not a member of
'CompileTimeError<false>'
templates.cpp: In instantiation of 'PrimeErrors<3>':
templates.cpp:25:   instantiated from 'PrimeErrors<4>'
templates.cpp:25:   instantiated from 'PrimeErrors<5>'
...
templates.cpp:34:   instantiated from here
templates.cpp:25: error: 'Cool' is not a member of 'CompileTimeError<false>'
templates.cpp:25: error: 'Cool' is not a member of
'CompileTimeError<false>'
templates.cpp: In instantiation of 'PrimeErrors<5>':
templates.cpp:25:   instantiated from 'PrimeErrors<6>'
templates.cpp:25:   instantiated from 'PrimeErrors<7>'
...
templates.cpp:34:   instantiated from here
templates.cpp:25: error: 'Cool' is not a member of 'CompileTimeError<false>'
templates.cpp:25: error: 'Cool' is not a member of
'CompileTimeError<false>'
==
Daca filtram doar liniile cu In instantiation of ..., vedem frumos rezultatul dorit:
== code(c) |
root@slack ~# gcc templates.cpp 2>&1 | grep "In in"
root@slack ~# gcc templates.cpp 2>&1 | grep "In in"
templates.cpp: In instantiation of 'PrimeErrors<2>':
templates.cpp: In instantiation of 'PrimeErrors<3>':
templates.cpp: In instantiation of 'PrimeErrors<5>':
templates.cpp: In instantiation of 'PrimeErrors<97>':
==
Dragut, nu?
Dragut, nu?

Nu exista diferente intre securitate.

Topicul de forum nu a fost schimbat.