Boost logo

Boost :

From: Synge Todo (wistaria_at_[hidden])
Date: 2003-04-11 03:09:53


Dear Boosters,

For SGI MIPSpro C++ compiler, I need the attached small patch to
boost/static_assert.hpp in order to compile with boost, since in some
situation the compiler does not accept boolian expressions for the
template parameter. E.g.

cc-1070 CC: ERROR File = /home/i004/i00400/src/boost/boost/random/normal_distribution.hpp, Line = 49
  The indicated type is incomplete.

      BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
      ^

Could someone apply this patch?

Best regards,

Synge Todo
wistaria_at_[hidden]

diff -crN boost_1_30_0.orig/boost/static_assert.hpp boost_1_30_0/boost/static_assert.hpp
*** boost_1_30_0.orig/boost/static_assert.hpp Sat Dec 28 01:51:53 2002
--- boost_1_30_0/boost/static_assert.hpp Wed Apr 9 19:43:34 2003
***************
*** 72,77 ****
--- 72,86 ----
  # define BOOST_STATIC_ASSERT( B ) \
      typedef char BOOST_JOIN(boost_static_assert_typedef_, __LINE__) \
          [ ::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >::value ]
+ #elif defined(__sgi)
+ // workaround for SGI MIPSpro compiler
+ #define BOOST_STATIC_ASSERT( B ) \
+ BOOST_STATIC_CONSTANT(bool, \
+ BOOST_JOIN(boost_static_assert_test_, __LINE__) = ( B )); \
+ typedef ::boost::static_assert_test<\
+ sizeof(::boost::STATIC_ASSERTION_FAILURE< \
+ BOOST_JOIN(boost_static_assert_test_, __LINE__) >)>\
+ BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
  #else
  // generic version
  #define BOOST_STATIC_ASSERT( B ) \


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