templates

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top