
8 Aug
2011
8 Aug
'11
3:11 p.m.
on Sat Aug 06 2011, Matt Calabrese <rivorus-AT-gmail.com> wrote:
C++0x has a simple answer to this -- default function template template arguments.
<snip>
There are two sort of subtle things here. First, the sizeof( A ) != 0 part is to force the condition to be dependent on a template argument. The other subtle thing is that the second template argument is a non-type template argument.
And this you're calling "simple?"
It was suggested that a macro should be made to hide the subtleties and make things more concise. In this situation it seems like it would simplify things a lot. I'll put something together and make sure it all gets to Release.
+1 -- Dave Abrahams BoostPro Computing http://www.boostpro.com