summaryrefslogtreecommitdiff
path: root/boost/accumulators/framework
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/framework')
-rw-r--r--boost/accumulators/framework/accumulators/droppable_accumulator.hpp2
-rw-r--r--boost/accumulators/framework/depends_on.hpp43
-rw-r--r--boost/accumulators/framework/parameters/accumulator.hpp2
-rw-r--r--boost/accumulators/framework/parameters/sample.hpp2
-rw-r--r--boost/accumulators/framework/parameters/weight.hpp2
-rw-r--r--boost/accumulators/framework/parameters/weights.hpp2
6 files changed, 49 insertions, 4 deletions
diff --git a/boost/accumulators/framework/accumulators/droppable_accumulator.hpp b/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
index 1beed664a3..0e882b5c35 100644
--- a/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
+++ b/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
@@ -215,7 +215,7 @@ namespace boost { namespace accumulators
template<typename Args>
void on_drop(Args const &args)
{
- // cache the result at the point this calcuation was dropped
+ // cache the result at the point this calculation was dropped
BOOST_ASSERT(!this->has_result());
this->set(this->Accumulator::result(args));
}
diff --git a/boost/accumulators/framework/depends_on.hpp b/boost/accumulators/framework/depends_on.hpp
index 76087b091d..c328972946 100644
--- a/boost/accumulators/framework/depends_on.hpp
+++ b/boost/accumulators/framework/depends_on.hpp
@@ -11,6 +11,8 @@
#include <boost/version.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/map.hpp>
+#include <boost/mpl/set.hpp>
+#include <boost/mpl/copy.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/sort.hpp>
@@ -26,6 +28,7 @@
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/transform_view.hpp>
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
@@ -94,15 +97,49 @@ namespace boost { namespace accumulators
template<typename A, typename B>
struct is_dependent_on
: is_base_and_derived<
- typename undroppable<B>::type
+ typename feature_of<typename undroppable<B>::type>::type
, typename undroppable<A>::type
>
{};
+ template<typename Feature>
+ struct dependencies_of
+ {
+ typedef typename Feature::dependencies type;
+ };
+
+ // Should use mpl::insert_range, but doesn't seem to work with mpl sets
+ template<typename Set, typename Range>
+ struct set_insert_range
+ : mpl::fold<
+ Range
+ , Set
+ , mpl::insert<mpl::_1, mpl::_2>
+ >
+ {};
+
+ template<typename Features>
+ struct collect_abstract_features
+ : mpl::fold<
+ Features
+ , mpl::set0<>
+ , set_insert_range<
+ mpl::insert<mpl::_1, feature_of<mpl::_2> >
+ , collect_abstract_features<dependencies_of<mpl::_2> >
+ >
+ >
+ {};
+
template<typename Features>
struct depends_on_base
: mpl::inherit_linearly<
- typename mpl::sort<Features, is_dependent_on<mpl::_1, mpl::_2> >::type
+ typename mpl::sort<
+ typename mpl::copy<
+ typename collect_abstract_features<Features>::type
+ , mpl::back_inserter<mpl::vector0<> >
+ >::type
+ , is_dependent_on<mpl::_1, mpl::_2>
+ >::type
// Don't inherit multiply from a feature
, mpl::if_<
is_dependent_on<mpl::_1, mpl::_2>
@@ -319,7 +356,7 @@ namespace boost { namespace accumulators
type;
};
- // BUGBUG work around a MPL bug wrt map insertion
+ // BUGBUG work around an MPL bug wrt map insertion
template<typename FeatureMap, typename Feature>
struct insert_feature
: mpl::eval_if<
diff --git a/boost/accumulators/framework/parameters/accumulator.hpp b/boost/accumulators/framework/parameters/accumulator.hpp
index 30e4b0de99..525ebb30ba 100644
--- a/boost/accumulators/framework/parameters/accumulator.hpp
+++ b/boost/accumulators/framework/parameters/accumulator.hpp
@@ -9,11 +9,13 @@
#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005
#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
namespace boost { namespace accumulators
{
BOOST_PARAMETER_KEYWORD(tag, accumulator)
+BOOST_ACCUMULATORS_IGNORE_GLOBAL(accumulator)
}} // namespace boost::accumulators
diff --git a/boost/accumulators/framework/parameters/sample.hpp b/boost/accumulators/framework/parameters/sample.hpp
index 9bfb665a57..8b227eb334 100644
--- a/boost/accumulators/framework/parameters/sample.hpp
+++ b/boost/accumulators/framework/parameters/sample.hpp
@@ -9,11 +9,13 @@
#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005
#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
namespace boost { namespace accumulators
{
BOOST_PARAMETER_KEYWORD(tag, sample)
+BOOST_ACCUMULATORS_IGNORE_GLOBAL(sample)
}} // namespace boost::accumulators
diff --git a/boost/accumulators/framework/parameters/weight.hpp b/boost/accumulators/framework/parameters/weight.hpp
index 86f133b914..f36016f372 100644
--- a/boost/accumulators/framework/parameters/weight.hpp
+++ b/boost/accumulators/framework/parameters/weight.hpp
@@ -9,12 +9,14 @@
#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005
#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
namespace boost { namespace accumulators
{
// The weight of a single sample
BOOST_PARAMETER_KEYWORD(tag, weight)
+BOOST_ACCUMULATORS_IGNORE_GLOBAL(weight)
}} // namespace boost::accumulators
diff --git a/boost/accumulators/framework/parameters/weights.hpp b/boost/accumulators/framework/parameters/weights.hpp
index 85b9e2fbd1..6beae61386 100644
--- a/boost/accumulators/framework/parameters/weights.hpp
+++ b/boost/accumulators/framework/parameters/weights.hpp
@@ -9,12 +9,14 @@
#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005
#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
namespace boost { namespace accumulators
{
// The weight accumulator
BOOST_PARAMETER_KEYWORD(tag, weights)
+BOOST_ACCUMULATORS_IGNORE_GLOBAL(weights)
}} // namespace boost::accumulators