Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-09-26 07:48:01


Ok, here is the rest of the patches for type_traits I have so far. The
basic problem is, IBM's vacpp 5 can't do this:

template <bool b> struct foo
{
     static const bool v = b;
};

template <bool b> struct bar
{
     static const bool v1 = b;
     static const bool v2 = foo<v1>::v;
};

It works if you replace foo<v1>::v with foo<b>::v.

Markus

Index: is_enum.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/type_traits/is_enum.hpp,v
retrieving revision 1.3
diff -c -r1.3 is_enum.hpp
*** is_enum.hpp 18 Sep 2002 04:44:32 -0000 1.3
--- is_enum.hpp 26 Sep 2002 12:43:43 -0000
***************
*** 84,89 ****
--- 84,95 ----
      typedef ::boost::detail::is_enum_helper<
            ::boost::detail::is_enum_impl<T>::selector
> se_t;
+ #elif defined(__IBMCPP__) && (__IBMCPP__ <= 502)
+ typedef typename ::boost::detail::is_enum_helper<
+ ::boost::type_traits::ice_or<
+ ::boost::is_arithmetic<T>::value
+ , ::boost::is_reference<T>::value
+ >::value> se_t;
  #else
      typedef ::boost::detail::is_enum_helper<selector> se_t;
  #endif
Index: type_with_alignment.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/type_traits/type_with_alignment.hpp,v
retrieving revision 1.2
diff -c -r1.2 type_with_alignment.hpp
*** type_with_alignment.hpp 15 Sep 2002 22:13:19 -0000 1.2
--- type_with_alignment.hpp 26 Sep 2002 12:43:43 -0000
***************
*** 90,97 ****
--- 90,102 ----
  
      BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);
  
+ #if !(defined(__IBMCPP__) && __IBMCPP__ <= 502)
      BOOST_STATIC_ASSERT(found >= Align);
      BOOST_STATIC_ASSERT(found % Align == 0);
+ #else
+ BOOST_STATIC_ASSERT(alignment_of<align_t>::value >= Align);
+ BOOST_STATIC_ASSERT(alignment_of<align_t>::value % Align == 0);
+ #endif
  
   public:
      typedef align_t type;


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