[Bug c++/15011] partial ordering failure?

dave at boost-consulting dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 19 17:29:00 GMT 2004


------- Additional Comments From dave at boost-consulting dot com  2004-04-19 16:15 -------
Au contraire, T can be deduced as X const.  Compile and run this:

-----
#include <cstdio>

template <class T, class X, class R = void*>
struct enable_if_same
{};

template <class X, class R>
struct enable_if_same<X, X, R>
{
    typedef R type;
};



struct X
{
    struct ref {};
    
    X(X&);
    X() {}
    
    template <class T>
    X(T&, typename enable_if_same<T const, X const>::type = 0) { std::printf
("told you so\n"); }

    operator ref();

    X(ref);
};

int main()
{
    X const x;
    X a(x);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15011



More information about the Gcc-bugs mailing list