This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13545] New: failure to cope with boost::is_class implementation
- From: "john_maddock at compuserve dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2004 12:18:47 -0000
- Subject: [Bug c++/13545] New: failure to cope with boost::is_class implementation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code demonstrates our "ideal world" implemenation of
boost::is_class, the code is conforming (I hope!), and works in cases that the
current gcc-specific workaround version does not. It is accepted by VC7.1,
Metrowerks, and EDG-based compilers, but unfortunately gcc-3.3 does not accept
this code.
#include <cassert>
namespace boost{
template <typename T>
struct is_class
{
template <class U> static char is_class_tester(void(U::*)(void));
template <class U> static double is_class_tester(...);
static const bool value =
(sizeof(is_class_tester<T>(0)) == sizeof(char));
};
}
int main()
{
assert(::boost::is_class<int>::value == 0);
return 0;
}
--
Summary: failure to cope with boost::is_class implementation
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: john_maddock at compuserve dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13545