
12 Apr
2011
12 Apr
'11
8:56 p.m.
On Tue, Apr 12, 2011 at 4:34 PM, Jeremy Maitin-Shepard <jeremy@jeremyms.com>wrote:
It seems that template aliases would further improve the syntax, but they are not yet supported by any compilers as far as I know.
Would SFINAE actually apply there or is that a level of indirection, causing a hard error? To be clear, I'm imagining something like this: template< bool V > struct enable_when_c_impl {}; template<> struct enable_when_c_impl< true > { typedef int type; }; template< bool V > using enable_when_c = typename enable_when_c_impl< V >::type; // SFINAE or error here when the condition is false? template< class T, enable_when_c< sizeof( T ) == 4 > = 0 > void foo( T ); -- -Matt Calabrese