Boost logo

Boost :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2007-03-30 11:03:32


Quoting Daniel Walker:

> Is this a substitution failure?

There is no substitution in your code, so a substitution failure cannot
happen.
Here is a real substitution, that does fail properly:

template<class T>
struct foo {
  template<class U> struct bar;
};

template<class T, class U>
void f(T,U) {}

template<class T, class U>
void f(T, typename foo<T>::template bar<T,U>) {}

int main()
{
    f(0,0);
}

I am not sure if it will help you though, as I don't know if you can afford to
protect the class you want to test (bar) into a dummy template (foo),
so that a
substitution happens. No template typedef...

Best regards,

Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk