Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-06-08 13:25:47


on 6/8/01 11:33 AM, larsbj_at_[hidden] wrote:

> Jens Maurer <Jens.Maurer_at_[hidden]> writes:
>
>
> Ok, this fix works. So we are using this until something better comes
> up.

What about something like:

BOOST_STATIC_CONSTANT( least, 1ul << (Bits - 1u) );
BOOST_STATIC_CONSTANT( fast, 1ul << (Bits - 1u) );

which would use implicit conversion to the final type.

> | larsbj_at_[hidden] wrote:
> | >
> | > We are trying to use the boost::crc lib with lyx, but have this
> | > problem with Compaq cxx:
> |
> | > Well, the test case is
> | > ------
> | > #include <boost/crc.hpp>
> | > ------
> | > The error message is
> |
> | > fantomas: cxx -V
> | > Compaq C++ V6.2-024 for Digital UNIX V4.0F (Rev. 1229)
> |
> | I could reproduce the error. Note that the regression tests use
> | Compaq C++ V6.3-008 now.
> |
> | BOOST_STATIC_CONSTANT is expanded to "static const", not "enum"
> | on this platform. I believe this is mostly ok. Using the "enum"
> | definition for BOOST_STATIC_CONSTANT leads to the same error.
> |
> | It appears that this compiler version does not regard integral
> | constant expressions involving type casts as such.
> |
> | Here's a fix which makes the regression test work. This fix
> | should be further conditioned on __DECCXX_VER < 60300000
> | (with a comment pointing to Compaq C++ 6.2-024). The fix
> | tastes sufficiently bad that I would prefer someone else
> | checks it into the CVS, possibly after approval by Daryle.

> | diff -u -r1.1 crc.hpp
> | --- crc.hpp 2001/05/16 12:55:41 1.1
> | +++ crc.hpp 2001/06/01 18:12:39
> | @@ -280,10 +280,15 @@
> | typedef typename base_type::least least;
> | typedef typename base_type::fast fast;
> |
> | +#ifdef __DECCXX
> | + static const least high_bit = 1ul << ( Bits - 1u );
> | + static const fast high_bit_fast = 1ul << ( Bits - 1u );
> | +#else
> | BOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << ( Bits
> | - 1u )) );
> | BOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << ( Bits
> | - 1u )) );
> | +#endif
> |
> | }; // boost::detail::high_uint_t
> |
> | @@ -340,7 +345,11 @@
> | BOOST_STATIC_CONSTANT( fast, high_bit_fast =
> base_type::high_bit_fast );
> | #endif
> |
> | +#ifdef __DECCXX
> | + static const least sig_bits = (~( ~( 0ul ) << Bits )) ;
> | +#else
> | BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits
> )) );
> | +#endif
> | BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );
> |
> | }; // boost::detail::mask_uint_t

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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