summaryrefslogtreecommitdiff
path: root/boost/accumulators/accumulators_fwd.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/accumulators_fwd.hpp')
-rw-r--r--boost/accumulators/accumulators_fwd.hpp66
1 files changed, 34 insertions, 32 deletions
diff --git a/boost/accumulators/accumulators_fwd.hpp b/boost/accumulators/accumulators_fwd.hpp
index 4c0370e21e..fabc4e8406 100644
--- a/boost/accumulators/accumulators_fwd.hpp
+++ b/boost/accumulators/accumulators_fwd.hpp
@@ -9,6 +9,8 @@
#define BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
#include <boost/config.hpp>
+#include <boost/core/enable_if.hpp>
+#include <boost/parameter/is_argument_pack.hpp>
#include <boost/mpl/apply_fwd.hpp> // for mpl::na
#include <boost/mpl/limits/vector.hpp>
#include <boost/preprocessor/cat.hpp>
@@ -41,7 +43,6 @@
#endif
#ifdef BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
-# include <boost/utility/enable_if.hpp>
# include <boost/type_traits/is_const.hpp>
# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\
, typename boost::disable_if<boost::is_const<T> >::type * = 0
@@ -128,9 +129,12 @@ template<typename Feature, typename AccumulatorSet>
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
extract_result(AccumulatorSet const &acc);
-template<typename Feature, typename AccumulatorSet, typename A1>
-typename mpl::apply<AccumulatorSet, Feature>::type::result_type
-extract_result(AccumulatorSet const &acc, A1 const &a1);
+namespace detail
+{
+ struct _enabler
+ {
+ };
+}
// ... other overloads generated by Boost.Preprocessor:
@@ -146,17 +150,37 @@ extract_result(AccumulatorSet const &acc, A1 const &a1);
extract_result( \
AccumulatorSet const &acc \
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \
+ , typename boost::enable_if< \
+ parameter::is_argument_pack<A0> \
+ , detail::_enabler \
+ >::type = detail::_enabler() \
+ ); \
+ template< \
+ typename Feature \
+ , typename AccumulatorSet \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \
+ > \
+ typename mpl::apply<AccumulatorSet, Feature>::type::result_type \
+ extract_result( \
+ AccumulatorSet const &acc \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \
+ , typename boost::disable_if< \
+ parameter::is_argument_pack<A0> \
+ , detail::_enabler \
+ >::type = detail::_enabler() \
);
/// INTERNAL ONLY
///
BOOST_PP_REPEAT_FROM_TO(
- 2
+ 1
, BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
, BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
, _
)
+#undef BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
+
#ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
template<typename Feature, typename AccumulatorSet, typename A1, typename A2 ...>
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
@@ -185,6 +209,9 @@ namespace detail
struct is_accumulator_set;
inline void ignore_variable(void const *) {}
+}
+
+}} // namespace boost::accumulators
#define BOOST_ACCUMULATORS_IGNORE_GLOBAL(X) \
namespace detail \
@@ -198,33 +225,8 @@ namespace detail
}; \
} \
/**/
-}
-}} // namespace boost::accumulators
+#include <boost/parameter/nested_keyword.hpp>
-// For defining boost::parameter keywords that can be inherited from to
-// get a nested, class-scoped keyword with the requested alias
-#define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias) \
- namespace tag_namespace \
- { \
- template<int Dummy = 0> \
- struct name ## _ \
- { \
- static char const* keyword_name() \
- { \
- return #name; \
- } \
- static ::boost::parameter::keyword<name ## _<Dummy> > &alias; \
- }; \
- template<int Dummy> \
- ::boost::parameter::keyword<name ## _<Dummy> > &name ## _<Dummy>::alias = \
- ::boost::parameter::keyword<name ## _<Dummy> >::get(); \
- typedef name ## _ <> name; \
- } \
- namespace \
- { \
- ::boost::parameter::keyword<tag_namespace::name> &name = \
- ::boost::parameter::keyword<tag_namespace::name>::get(); \
- }
+#endif // include guard
-#endif