|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61946 - in sandbox/SOC/2010/bit_masks: boost/integer lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-05-13 10:35:51
Author: bbartman
Date: 2010-05-13 10:35:50 EDT (Thu, 13 May 2010)
New Revision: 61946
URL: http://svn.boost.org/trac/boost/changeset/61946
Log:
fixed some errors within my tesing of low bits file
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp | 8 ++------
sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 29 ++++++++---------------------
2 files changed, 10 insertions(+), 27 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp 2010-05-13 10:35:50 EDT (Thu, 13 May 2010)
@@ -15,12 +15,8 @@
template <typename T, T Width>
struct low_bits
- :integral_constant<T, (~T(0) << Width) >
-{
- // typedef integral_constant<T, (~T(0) << Width) > integral_type;
- // using integral_type::value;
- // using integral_type::type;
-};
+ :integral_constant<T, ~(~T(0) << Width) >
+{ };
} // namespace boost
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp 2010-05-13 10:35:50 EDT (Thu, 13 May 2010)
@@ -3,8 +3,9 @@
#include <boost/assert.hpp>
#include <boost/type_traits.hpp>
#include <boost/integer/high_low_bits.hpp>
-#include <except>
-#include <string.h>
+
+// #include <iostream>
+// #include <fstream>
// Testing of low_bits function.
@@ -13,31 +14,17 @@
using namespace boost;
-struct bit_exception
- :except
-{
- void setValue(char* c) {
- m_value = c;
- }
-
- virtual const char* what() const {
- return "Failure: value is: " + m_value + "\n";
- }
-
- char* m_value;
-};
-typedef low_bits<unsigned int, 3>::type lbits;
+typedef low_bits<unsigned int, 3> lbits;
int main() {
+ // ofstream log("log.cpp");
+ // log << lbits::value << endl;
- bit_exception be;
- be.setValue( );
- throw(be);
// throw(lbits::value);
// std::cerr << lbits::value << std::endl;
- BOOST_ASSERT(( is_same< lbits::type, unsigned int>::type::value ));
- // BOOST_ASSERT(( lbits::value == 7 ));
+ BOOST_ASSERT(( is_same< lbits::value_type, unsigned int>::value ));
+ BOOST_ASSERT(( lbits::value == 7 ));
// using namespace std;
return 0;
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