Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-14 21:11:12


----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>

> Fwiw, here's another possible implementation of is_class on
Metrowerks:
>
> #ifdef __MWERKS__
>
> #include <msl_utility>
>
> namespace boost
> {
> using Metrowerks::is_class;
> }
>
> #endif
>
> Using this technique, even boost:is_union will work. But there may be
> some minor differences between Metrowerks type_traits and boost
> type_traits, such as facilities one lib has and the other doesn't.

FWIW, when I replace is_class by this implementation for metrowerks
(well, actually I need to write

    template <class T> struct is_class : Metrowerks::is_class<T> {};

because using-declarations are not quite equivalent to normal ones), I
get the following errors with Pro7.2. Interestingly, I get the first set
of errors anyway with the existing definition of is_class. However, the
is_function compilation failures only happen with the MWERKS is_class
implementation.

Shouldn't your is_class report false for enum_UDT?

It's not clear where the expectation of 19 failures for Pro7.2 comes
from, but something seems to have increased the number of actual
failures by 2 in recent releases...

*
***************** failed above test: object_type_traits_test
********************
checking value of boost::is_class<enum_UDT>::value...failed
 found: 1 expected 0
checking value of boost::is_POD<enum_UDT>::value...failed
 found: 0 expected 1
checking value of
boost::has_trivial_constructor<empty_UDT>::value...failed
 found: 0 expected 1
checking value of
boost::has_trivial_constructor<enum_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_trivial_copy<empty_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_trivial_copy<enum_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_trivial_assign<empty_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_trivial_assign<enum_UDT>::value...failed
 found: 0 expected 1
checking value of
boost::has_trivial_destructor<enum_UDT>::value...failed
 found: 0 expected 1
checking value of
boost::has_nothrow_constructor<empty_UDT>::value...failed
 found: 0 expected 1
checking value of
boost::has_nothrow_constructor<enum_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_nothrow_copy<empty_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_nothrow_copy<enum_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_nothrow_assign<empty_UDT>::value...failed
 found: 0 expected 1
checking value of boost::has_nothrow_assign<enum_UDT>::value...failed
 found: 0 expected 1
checking value of boost::is_empty<int[2]>::value...failed
   boost::is_empty<int[2]>::value does not compile on this compiler
checking value of boost::is_empty<empty_union_UDT>::value...failed
   boost::is_empty<empty_union_UDT>::value does not compile on this
compiler
checking value of boost::is_empty<enum_UDT>::value...failed
   boost::is_empty<enum_UDT>::value does not compile on this compiler
checking value of
(boost::is_base_and_derived<Derived,Derived>::value)...failed
 found: 0 expected 1
checking value of
(boost::is_base_and_derived<Base,Base>::value)...failed
 found: 0 expected 1
checking value of
(boost::is_base_and_derived<Base,Derived>::value)...failed
 found: 0 expected 1
201 tests completed, 21 failures found, 19 failures expected from this
compiler.

### mwcc Compiler:
# In: ..\boost\type_traits\object_traits.hpp
# From: ..\libs\type_traits\tests\is_function_test.cpp
# -------------------------------------------------------
# 400: struct empty_helper_t1 : public T
# Error: ^
# illegal struct/union/enum/class definition
# (instantiating: 'is_function_tester<void (int, bool, int *, int *,
int, int, int, int, int)>::check()')
# (instantiating: 'boost::is_empty<void (int, bool, int *, int *,
int, int, int, int, int)>')
# (instantiating: 'boost::detail::empty_helper<void (int, bool, int
*, int *, int, int, int, int, int), 1, 0>')
# (instantiating: 'boost::detail::empty_helper_t1<void (int, bool,
int *, int *, int, int, int, int, int)>')
### mwcc Compiler:
# 400: struct empty_helper_t1 : public T
# Error: ^
# illegal struct/union/enum/class definition
# (instantiating: 'is_function_tester<void (int &, bool, int,
int)>::check()')
# (instantiating: 'boost::is_empty<void (int &, bool, int, int)>')
# (instantiating: 'boost::detail::empty_helper<void (int &, bool,
int, int), 1, 0>')
# (instantiating: 'boost::detail::empty_helper_t1<void (int &,
bool, int, int)>')
### mwcc Compiler:
# 400: struct empty_helper_t1 : public T
# Error: ^
# illegal struct/union/enum/class definition
# (instantiating: 'is_function_tester<void (int &,
double)>::check()')
# (instantiating: 'boost::is_empty<void (int &, double)>')
# (instantiating: 'boost::detail::empty_helper<void (int &,
double), 1, 0>')
# (instantiating: 'boost::detail::empty_helper_t1<void (int &,
double)>')
### mwcc Compiler:
# 400: struct empty_helper_t1 : public T
# Error: ^
# illegal struct/union/enum/class definition
# (instantiating: 'is_function_tester<void (int)>::check()')
# (instantiating: 'boost::is_empty<void (int)>')
# (instantiating: 'boost::detail::empty_helper<void (int), 1, 0>')
# (instantiating: 'boost::detail::empty_helper_t1<void (int)>')
### mwcc Compiler:
# 400: struct empty_helper_t1 : public T
# Error: ^
# illegal struct/union/enum/class definition
# (instantiating: 'is_function_tester<void ()>::check()')
# (instantiating: 'boost::is_empty<void ()>')
# (instantiating: 'boost::detail::empty_helper<void (), 1, 0>')
# (instantiating: 'boost::detail::empty_helper_t1<void ()>')


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk