W
Wolfgang Meyer
Does someone know some metrics of how well common C++ compilers (say
g++ 3.2.x, vc++ 7.x) remove code that is unreachable in certain
instantiations of templates?
For example:
template<bool c>
class foo
{
void bar()
{
if(c)
do_stuff();
else
do_other_stuff();
}
};
Will the code generated for foo<false>::bar() just be
"do_other_stuff();"?
I tried to look at the output of g++ that is delivered with option
"-df". But I could not really decipher it. It nearly looked like Lisp!
;-)
g++ 3.2.x, vc++ 7.x) remove code that is unreachable in certain
instantiations of templates?
For example:
template<bool c>
class foo
{
void bar()
{
if(c)
do_stuff();
else
do_other_stuff();
}
};
Will the code generated for foo<false>::bar() just be
"do_other_stuff();"?
I tried to look at the output of g++ that is delivered with option
"-df". But I could not really decipher it. It nearly looked like Lisp!
;-)