[Bug c++/13545] New: failure to cope with boost::is_class implementation
john_maddock at compuserve dot com
gcc-bugzilla@gcc.gnu.org
Fri Jan 2 12:18:00 GMT 2004
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
More information about the Gcc-bugs
mailing list