N
Noah Roberts
I have a function that takes a template parameter that could be
anything. Within this function is the following:
else if (is_function<T>::value)
{
typedef function_traits<T> ftraits;
out << type_descriptor<ftraits::result_type>() << "(";
out << ")";
}
The problem here is that is_function<T>::value can sometimes be false.
That being the case, this area of the function fails to compile, even
though it will never be called.
I think I'm going to solve this by putting all that this area does
inside of a class that can be overriden with false information to be a
noop. But I'm wondering if there isn't a better method.
anything. Within this function is the following:
else if (is_function<T>::value)
{
typedef function_traits<T> ftraits;
out << type_descriptor<ftraits::result_type>() << "(";
out << ")";
}
The problem here is that is_function<T>::value can sometimes be false.
That being the case, this area of the function fails to compile, even
though it will never be called.
I think I'm going to solve this by putting all that this area does
inside of a class that can be overriden with false information to be a
noop. But I'm wondering if there isn't a better method.