
30 Jan
2009
30 Jan
'09
2:21 p.m.
In a class, I want to have one member function which has different
implementations depending on one of the template parameters. I tried
to use enable_if
template<bool b>
struct foo
{
typename boost::enable_if_c::type
get_val( )
{ return 2; }
typename boost::disable_if_c::type
get_val()
{ return 3; }
};
But when I use foo in code, it doesn't work, complaning that:
error: no type named 'type' in 'struct boost::enable_if_c