|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63053 - in sandbox/SOC/2010/bit_masks: boost/integer/details/bft/ext boost/integer/details/bft/ext/fusion lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-06-17 14:28:26
Author: bbartman
Date: 2010-06-17 14:28:25 EDT (Thu, 17 Jun 2010)
New Revision: 63053
URL: http://svn.boost.org/trac/boost/changeset/63053
Log:
completed fusion extension size
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp | 2 +-
sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/size_impl.hpp | 33 +++++++++++++++++++++++++++++++++
sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp | 6 ++++++
3 files changed, 40 insertions(+), 1 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/bitfield_tuple_fusion_includes.hpp 2010-06-17 14:28:25 EDT (Thu, 17 Jun 2010)
@@ -17,8 +17,8 @@
#include "fusion/category_of_impl.hpp"
#include "fusion/at_impl.hpp"
#include "fusion/begin_impl.hpp"
-#include "fusion/end_impl.hpp"
#include "fusion/size_impl.hpp"
+#include "fusion/end_impl.hpp"
#include "fusion/at_key_impl.hpp"
#include "fusion/has_key_impl.hpp"
#include "fusion/value_at_impl.hpp"
Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/size_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/size_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bft/ext/fusion/size_impl.hpp 2010-06-17 14:28:25 EDT (Thu, 17 Jun 2010)
@@ -2,3 +2,36 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_BITFELD_TUPLE_FUSION_EXT_SIZE_HPP
+#define BOOST_BITFELD_TUPLE_FUSION_EXT_SIZE_HPP
+#include <boost/mpl/size.hpp>
+
+
+namespace boost {
+
+struct bitfield_tuple_tag;
+
+namespace fusion { namespace extension {
+
+
+template <typename> struct size_impl;
+
+template <>
+struct size_impl< bitfield_tuple_tag > {
+
+ template <typename BitfieldTuple>
+ struct apply {
+ typedef typename mpl::size<
+ typename BitfieldTuple::members
+ >::type type;
+
+ // non-const at function.
+ static type call(BitfieldTuple& bft) {
+ return type();
+ }
+ };
+};
+
+}}} // end boost::fusion::extension
+#endif
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/fusion_integration_testing.cpp 2010-06-17 14:28:25 EDT (Thu, 17 Jun 2010)
@@ -69,6 +69,12 @@
temp.get<red>() = 4;
BOOST_ASSERT(( fusion::deref(fusion::begin(temp)) == 4));
}
+
+ // size testing
+ {
+ test_tuple temp;
+ BOOST_ASSERT(( fusion::size(temp) == 3 ));
+ }
/*
bmg_t bmg;
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