Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63978 - sandbox/SOC/2010/bit_masks/boost/integer
From: bbartmanboost_at_[hidden]
Date: 2010-07-13 14:26:55


Author: bbartman
Date: 2010-07-13 14:26:54 EDT (Tue, 13 Jul 2010)
New Revision: 63978
URL: http://svn.boost.org/trac/boost/changeset/63978

Log:
attempting a different type of fix for msvc
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp | 29 ++++++++++++++++++++++++-----
   1 files changed, 24 insertions(+), 5 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp 2010-07-13 14:26:54 EDT (Tue, 13 Jul 2010)
@@ -33,19 +33,38 @@
 #pragma warning(disable : 4309)
 // #pragma warning(disable : 4305)
 namespace detail {
+
     template<typename T, unsigned int Width>
     struct evaluate_for_msvc_08 {
         typedef typename make_unsigned<T>::type unsigned_type;
- BOOST_STATIC_CONSTANT(T, val = static_cast<T>(~(mpl::shift_right<
- integral_constant<
- unsigned_type,
- ~( unsigned_type(0) )
- >,
+ BOOST_STATIC_CONSTANT(T, val = (~(mpl::shift_right<
+ mpl::size_t<~( T(0) )>,
             mpl::size_t<Width>
>::type::value)
         ));
         typedef integral_constant<T, val> type;
     };
+ // long long specialization
+ template<unsigned int Width>
+ struct evaluate_for_msvc_08<long long, Width> {
+ BOOST_STATIC_CONSTANT(T, val = (~(mpl::shift_right<
+ integral_constant< long long,~( unsigned long long(0) )>,
+ mpl::size_t<Width>
+ >::type::value)
+ ));
+ typedef integral_constant<long long, val> type;
+ };
+ // unsigned long long specialization
+ template<unsigned int Width>
+ struct evaluate_for_msvc_08<unsigned long long, Width> {
+ BOOST_STATIC_CONSTANT(T, val = (~(mpl::shift_right<
+ integral_constant< unsigned long long, ~( unsigned long long(0) )>,
+ mpl::size_t<Width>
+ >::type::value)
+ ));
+ typedef integral_constant<unsigned long long, val> type;
+ };
+
 }
 
 #pragma warning(pop)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk