Template fallthrough

I read somewhere that template instantiation failure is not a compiler error and the compiler will keep trying instantiations until it runs out. I have no idea how this works, though.

I'm trying to solve a puzzle someone gave me. I have to use C++03, and I have to use a templated function that takes a functor and invokes it either with no parameters or with two parameters depending on the functor given.

I've got this, but it's ugly and doesn't quite work like I hoped:

How can I make use of the template fallthrough mechanics?
Are you talking about the SFINAE?


I'm not sure on how more I can help you, maybe the book "C++ Templates - The Complete Guide" can help you.
Topic archived. No new replies allowed.