|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63356 - in sandbox/SOC/2010/bit_masks: boost/integer/details lib/integer/test lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-06-26 12:21:35
Author: bbartman
Date: 2010-06-26 12:21:34 EDT (Sat, 26 Jun 2010)
New Revision: 63356
URL: http://svn.boost.org/trac/boost/changeset/63356
Log:
completed testing work for deduced internal type this means that the user doesn't havet to supply a storage type although the option to do so is still there
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/details/bitfield_tuple_impl.hpp | 15 +++++++++++++--
sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 6 +++++-
sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_long_long_test.cpp | 7 ++++++-
sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_test.cpp | 19 +++++++++++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bitfield_tuple_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bitfield_tuple_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bitfield_tuple_impl.hpp 2010-06-26 12:21:34 EDT (Sat, 26 Jun 2010)
@@ -64,18 +64,28 @@
// extracting te Arguments from processed_args relating to
// the storage policy. Also preforming static assertios
// where they can be done.
- typedef typename processed_args::storage_policy storage_type;
+ typedef typename processed_args::storage_policy processed_storage_type;
typedef typename processed_args::field_vector field_vector;
typedef typename processed_args::offset offset;
// Precondition:
// A storage policy must be supplied.
- BOOST_STATIC_ASSERT((
+ /* BOOST_STATIC_ASSERT((
!is_same<
storage_type,
typename mpl::void_
>::value
));
+ */
+ // deducing storage type
+ typedef typename mpl::if_<
+ is_same<
+ processed_storage_type,
+ mpl::void_
+ >,
+ typename details::deduce_storage_type<offset>::type,
+ processed_storage_type
+ >::type storage_type;
@@ -93,4 +103,5 @@
}} // end boost::details
#undef BOOST_BFT_ARG_PROCESSING
+
#endif
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 2010-06-26 12:21:34 EDT (Sat, 26 Jun 2010)
@@ -45,6 +45,10 @@
[ run bft_testing/align_test.cpp ]
[ run bft_testing/reference_builder_test.cpp ]
[ run bft_testing/deduced_storage_type_test.cpp ]
- [ run bft_testing/deduced_storage_type_long_long_test.cpp ]
+ [ run bft_testing/deduced_storage_type_long_long_test.cpp
+ :
+ :
+ :
+ <toolset>gcc:<cxxflags>-Wno-long-long <toolset>darwin:<cxxflags>-Wno-long-long ]
;
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_long_long_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_long_long_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_long_long_test.cpp 2010-06-26 12:21:34 EDT (Sat, 26 Jun 2010)
@@ -16,9 +16,14 @@
struct blue;
struct salmon;
-
+typedef bitfield_tuple<
+ flag<pink>,
+ bit_align<64>
+> test_tuple;
int main() {
+
+ BOOST_ASSERT(( is_same<test_tuple::storage_type,uint_least64_t>::value ));
return 0;
}
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/deduced_storage_type_test.cpp 2010-06-26 12:21:34 EDT (Sat, 26 Jun 2010)
@@ -6,6 +6,7 @@
#include <boost/integer/bitfield_tuple.hpp>
#include <boost/assert.hpp>
+#include <boost/mpl/assert.hpp>
using namespace boost;
@@ -17,8 +18,26 @@
struct salmon;
+typedef bitfield_tuple<
+ flag<green>,
+ bit_align<16>
+> test_16;
+
+typedef bitfield_tuple<
+ flag<pink>,
+ bit_align<8>
+> test_8;
+
+typedef bitfield_tuple<
+ flag<red>,
+ bit_align<32>
+> test_32;
+
int main() {
+ BOOST_MPL_ASSERT(( is_same<test_8::storage_type, uint_least8_t> ));
+ BOOST_MPL_ASSERT(( is_same<test_16::storage_type, uint_least16_t> ));
+ BOOST_MPL_ASSERT(( is_same<test_32::storage_type, uint_least32_t> ));
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