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++/13545] New: failure to cope with boost::is_class implementation


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


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