This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13156] Greedy instantiation


------- Additional Comments From dave at boost-consulting dot com  2003-11-21 19:13 -------
Well, you're wrong about that, but even if you weren't:

------

struct X
{
    template <class T>
    X(T const&) { T x = 1; }
};

template <class From, class To>
struct conv1
{
    
    static char (& _m_check(...) )[2];
    static char _m_check(To);
    static From _m_from;
};

template <class From, class To>
struct conv
{
    enum {
        value = sizeof( conv1<From,To>::_m_check(conv1<From,To>::_m_from) ) == 
1
    };
};

int x[conv<char*,X>::value ? 1 : -1];


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]