On 3/29/2011 2:51 AM, Michael Kaes wrote:
I want that the first Ctor is only available when a NullType is passed in and if not that the second one is available but not the first. I don't want to do a class specialization because the class is rather big and extracting all the methods to a common class would be difficult. So how can I reuse the template parameter U for the Ctors enable_if? Or is this simply not possible?
For cases like this you do not actually need to enable/disable your
constructor using enable_if or friends. Remember, a member of a
template class is not instantiated if it is not used. Thus...
struct nil_ {};
struct test {};
struct non_nil {};
#include