This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13156] Greedy instantiation
- From: "dave at boost-consulting dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2003 19:13:54 -0000
- Subject: [Bug c++/13156] Greedy instantiation
- References: <20031121184004.13156.dave@boost-consulting.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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