Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2003-04-13 12:56:15


On Sat, 12 Apr 2003 12:35:38 +0200, John Maddock wrote:

>> I just tried to include <boost/type_traits.hpp> to use the function
>> traits, but I didn't work. Seems it was simply forgotten to include
>> function_traits.hpp, otherwise the docs would need some extension. :)
>
> Fixed in cvs, while I'm at it, can you please resend your is_class
> gcc-warning patch I seem to have lost it :-(

Sure. It's actually a patch for is_enum.hpp but it fixes warnings for
both is_class and is_enum, namely:

test::is_class< int( int ) >::value
test::is_enum< int( int ) >::value

I added the fix globally, but if you prefer to remove the dependency to
is_function for other compilers, you can add a guard.

Also, IIRC, the comment from Dave seen below is lying (due to changes
that happened after he wrote it). Maybe we should fix this up, too. It
would IMHO lead to the removal of the #ifdef-block, but I didn't wanted
to mix it up with the fix for the warnings, so I left it out for now.

Regards, Daniel

--- /home/dfrey/work/boost_1_30_0/boost/type_traits/is_enum.hpp Sun Apr 13 19:39:50 2003
+++ type_traits/is_enum.hpp Sun Apr 13 19:42:38 2003
@@ -15,6 +15,7 @@
 #include "boost/type_traits/is_arithmetic.hpp"
 #include "boost/type_traits/is_reference.hpp"
 #include "boost/type_traits/is_convertible.hpp"
+#include "boost/type_traits/is_function.hpp"
 #include "boost/type_traits/config.hpp"
 
 #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
@@ -65,6 +66,7 @@
       (::boost::type_traits::ice_or<
            ::boost::is_arithmetic<T>::value
          , ::boost::is_reference<T>::value
+ , ::boost::is_function<T>::value
        // We MUST do this on conforming compilers in order to
        // correctly deduce that noncopyable types are not enums (dwa
        // 2002/04/15)...
@@ -75,6 +77,7 @@
       (::boost::type_traits::ice_or<
            ::boost::is_arithmetic<T>::value
          , ::boost::is_reference<T>::value
+ , ::boost::is_function<T>::value
        // However, not doing this on non-conforming compilers prevents
        // a dependency recursion.
>::value));


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