Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61585 - in sandbox/statistics/support: . boost boost/accumulators boost/accumulators/framework boost/accumulators/framework/detail boost/fusion boost/fusion/container boost/fusion/container/map boost/fusion/container/map/detail boost/mpl boost/mpl/detail boost/parameter boost/parameter/detail
From: erwann.rogard_at_[hidden]
Date: 2010-04-26 16:41:20


Author: e_r
Date: 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
New Revision: 61585
URL: http://svn.boost.org/trac/boost/changeset/61585

Log:
a
Added:
   sandbox/statistics/support/
   sandbox/statistics/support/boost/
   sandbox/statistics/support/boost/accumulators/
   sandbox/statistics/support/boost/accumulators/framework/
   sandbox/statistics/support/boost/accumulators/framework/detail/
   sandbox/statistics/support/boost/accumulators/framework/detail/unpack_depends_on.hpp (contents, props changed)
   sandbox/statistics/support/boost/fusion/
   sandbox/statistics/support/boost/fusion/container/
   sandbox/statistics/support/boost/fusion/container/map/
   sandbox/statistics/support/boost/fusion/container/map/detail/
   sandbox/statistics/support/boost/fusion/container/map/detail/extract_keys.hpp (contents, props changed)
   sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_map.hpp (contents, props changed)
   sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_pairs.hpp (contents, props changed)
   sandbox/statistics/support/boost/fusion/container/map/detail/unpack_map.hpp (contents, props changed)
   sandbox/statistics/support/boost/mpl/
   sandbox/statistics/support/boost/mpl/detail/
   sandbox/statistics/support/boost/mpl/detail/partition_by_position_parity.hpp (contents, props changed)
   sandbox/statistics/support/boost/mpl/detail/sequence_to_unpack_variadic.hpp (contents, props changed)
   sandbox/statistics/support/boost/parameter/
   sandbox/statistics/support/boost/parameter/detail/
   sandbox/statistics/support/boost/parameter/detail/unpack_parameters.hpp (contents, props changed)

Added: sandbox/statistics/support/boost/accumulators/framework/detail/unpack_depends_on.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/accumulators/framework/detail/unpack_depends_on.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,33 @@
+///////////////////////////////////////////////////////////////////////////////
+// unpack_depends_on.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_ACCUMULATORS_DETAIL_UNPACK_DEPENDS_ON_HPP_ER_2010
+#define BOOST_ACCUMULATORS_DETAIL_UNPACK_DEPENDS_ON_HPP_ER_2010
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
+#include <boost/accumulators/framework/depends_on.hpp>
+#include <boost/mpl/detail/sequence_to_unpack_variadic.hpp>
+
+namespace boost{
+namespace accumulators{
+namespace detail{
+
+ // typedef boost::mpl::vector<tag1,...,tagn> tags_;
+ // typedef unpack_depends_on<tags_>::type depends_on_;
+ BOOST_DETAIL_MPL_SEQUENCE_TO_UNPACK_VARIADIC(
+ boost::accumulators::depends_on,
+ unpack_depends_on,
+ 0,
+ BOOST_ACCUMULATORS_MAX_FEATURES,
+ boost::mpl::na
+ );
+
+}// detail
+}// accumulators
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/fusion/container/map/detail/extract_keys.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/fusion/container/map/detail/extract_keys.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////
+// extract_keys.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_FUSION_CONTAINER_MAP_DETAIL_EXTRACT_KEYS_HPP_ER_2010
+#define BOOST_FUSION_CONTAINER_MAP_DETAIL_EXTRACT_KEYS_HPP_ER_2010
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/vector/vector0.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/fusion/mpl.hpp> // likely to be needed by client
+
+namespace boost {
+namespace fusion{
+namespace detail{
+
+ template<typename Map>
+ struct extract_keys{
+
+ template<typename P>
+ struct extract_first{
+ typedef typename P::first_type type;
+ };
+
+ typedef typename Map::storage_type storage_;
+ typedef typename boost::mpl::fold<
+ storage_,
+ boost::mpl::vector0<>,
+ boost::mpl::push_back<
+ boost::mpl::_1,
+ extract_first<boost::mpl::_2>
+ >
+ >::type type;
+ };
+
+}// detail
+}// fusion
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_map.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_map.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,34 @@
+///////////////////////////////////////////////////////////////////////////////
+// sequence_to_map.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_FUSION_CONTAINER_MAP_DETAIL_SEQUENCE_TO_MAP_HPP_ER_2010
+#define BOOST_FUSION_CONTAINER_MAP_DETAIL_SEQUENCE_TO_MAP_HPP_ER_2010
+#include <boost/fusion/container/map/detail/sequence_to_pairs.hpp>
+#include <boost/fusion/container/map/detail/unpack_map.hpp>
+
+namespace boost{
+namespace fusion{
+namespace detail{
+
+ // sequence_to_map<mpl::vector<K1,D1,...,Kn,Dn> >
+ template<typename T>
+ struct sequence_to_map{
+
+ typedef typename
+ boost::fusion::detail::sequence_to_pairs<T> traits_;
+ typedef typename traits_::keys_ keys_;
+ typedef typename traits_::datas_ datas_;
+ typedef typename traits_::type pairs_;
+ typedef typename boost::fusion::detail::unpack_map<pairs_>::type type;
+
+ };
+
+}// detail
+}// fusion
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_pairs.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/fusion/container/map/detail/sequence_to_pairs.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////////////////////
+// sequence_to_pairs.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_FUSION_CONTAINER_MAP_DETAIL_SEQUENCE_TO_PAIRS_HPP_ER_2010
+#define BOOST_FUSION_CONTAINER_MAP_DETAIL_SEQUENCE_TO_PAIRS_HPP_ER_2010
+#include <boost/fusion/include/pair.hpp>
+
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/bind.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/unpack_args.hpp>
+#include <boost/mpl/vector/vector10.hpp>
+#include <boost/mpl/zip_view.hpp>
+
+#include <boost/mpl/detail/partition_by_position_parity.hpp>
+
+namespace boost{
+namespace fusion{
+namespace detail{
+
+ // sequence_to_pairs<mpl::vector<K1,D1,...,Kn,Dn> >::type
+ template<typename T>
+ struct sequence_to_pairs{
+
+ typedef typename boost::mpl::detail::partition_by_position_parity<
+ T>::type partition_;
+ typedef typename partition_::first keys_;
+ typedef typename partition_::second datas_;
+
+ typedef boost::mpl::transform_view<
+ boost::mpl::zip_view< boost::mpl::vector2<keys_,datas_> >
+ , boost::mpl::unpack_args<
+ boost::fusion::pair<boost::mpl::_1,boost::mpl::_2>
+ >
+ > type;
+
+ };
+
+}// detail
+}// fusion
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/fusion/container/map/detail/unpack_map.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/fusion/container/map/detail/unpack_map.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,32 @@
+///////////////////////////////////////////////////////////////////////////////
+// unpack_map.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_FUSION_CONTAINER_MAP_DETAIL_UNPACK_MAP_HPP_ER_2010
+#define BOOST_FUSION_CONTAINER_MAP_DETAIL_UNPACK_MAP_HPP_ER_2010
+#include <boost/fusion/include/map.hpp>
+#include <boost/fusion/include/void.hpp>
+#include <boost/mpl/detail/sequence_to_unpack_variadic.hpp>
+
+namespace boost{
+namespace fusion{
+namespace detail{
+
+ // typedef mpl::vector<fusion::pair<K1,D1>,...fusion::pair<K1,D1> > vec_;
+ // typedef unpack_map<vec_>::type map_;
+ BOOST_DETAIL_MPL_SEQUENCE_TO_UNPACK_VARIADIC(
+ boost::fusion::map,
+ unpack_map,
+ 0,
+ BOOST_PARAMETER_MAX_ARITY,
+ boost::fusion::void_
+ );
+
+}// detail
+}// parameter
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/mpl/detail/partition_by_position_parity.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/mpl/detail/partition_by_position_parity.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////////
+// partition_by_position_parity.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_MPL_DETAIL_PARTITION_BY_POSITION_PARITY_HPP_ER_2010
+#define BOOST_MPL_DETAIL_PARTITION_BY_POSITION_PARITY_HPP_ER_2010
+
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/bind.hpp>
+#include <boost/mpl/inserter.hpp>
+#include <boost/mpl/math/is_even.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/zip_view.hpp>
+#include <boost/mpl/partition.hpp>
+#include <boost/mpl/pair.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/unpack_args.hpp>
+
+namespace boost {
+namespace mpl{
+namespace detail{
+
+ // Usage:
+ // partition_by_position_parity< vector<a,x,b,y> >::type
+ // equivalent to
+ // pair< vector<a,b>, vector<x,y> >
+ template<typename T>
+ struct partition_by_position_parity{
+
+ typedef typename boost::mpl::size<T>::type size_;
+ typedef boost::mpl::range_c<int,0,size_::value> range_;
+ typedef boost::mpl::zip_view< boost::mpl::vector<T, range_> > zip_view_;
+
+ template<typename Seq>
+ struct fetch : boost::mpl::apply<
+ boost::mpl::unpack_args<boost::mpl::_1>,
+ Seq
+ >{};
+
+ struct inserter : boost::mpl::inserter<
+ boost::mpl::vector0<>,
+ boost::mpl::push_back<
+ boost::mpl::_1,
+ fetch<boost::mpl::_2>
+ >
+ >{};
+
+ typedef typename boost::mpl::partition<
+ zip_view_
+ , boost::mpl::unpack_args< boost::mpl::is_even<boost::mpl::_2> >,
+ inserter,
+ inserter
+ >::type type;
+
+ };
+
+}// detail
+}// mpl
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/mpl/detail/sequence_to_unpack_variadic.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/mpl/detail/sequence_to_unpack_variadic.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,46 @@
+///////////////////////////////////////////////////////////////////////////////
+// sequence_to_unpack_variadic.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_MPL_DETAIL_SEQUENCE_TO_UNPACK_VARIADIC_HPP_ER_2010
+#define BOOST_MPL_DETAIL_SEQUENCE_TO_UNPACK_VARIADIC_HPP_ER_2010
+
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/unpack_args.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+
+// Usage: Let 0<=i2<n2
+// to< mpl::vector<T1,...,Tn1,U1,...Ui2> >::type = from<T1,..,Tn1,U1,...,Ui2>
+
+#define BOOST_DETAIL_MPL_SEQUENCE_TO_UNPACK_VARIADIC(from,to,n1,n2,default) \
+template<typename Seq> \
+struct to{ \
+ \
+ struct meta{ \
+ template< \
+ BOOST_PP_ENUM_PARAMS(n1, typename T) \
+ BOOST_PP_COMMA_IF(n1) \
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(n2, typename U, default) \
+ > \
+ struct apply{ \
+ typedef from< \
+ BOOST_PP_ENUM_PARAMS(n1, T) \
+ BOOST_PP_COMMA_IF(n1) \
+ BOOST_PP_ENUM_PARAMS(n2, U) \
+ > type; \
+ }; \
+ }; \
+ \
+ typedef typename boost::mpl::apply< \
+ boost::mpl::unpack_args<typename to::meta>, \
+ Seq \
+ >::type type; \
+}; \
+/**/
+
+#endif

Added: sandbox/statistics/support/boost/parameter/detail/unpack_parameters.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/parameter/detail/unpack_parameters.hpp 2010-04-26 16:41:19 EDT (Mon, 26 Apr 2010)
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////
+// unpack_parameters.hpp //
+// //
+// Copyright 2010 Erwann Rogard. 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_ACCUMULATORS_DETAIL_UNPACK_PARAMETERS_HPP_ER_2010
+#define BOOST_ACCUMULATORS_DETAIL_UNPACK_PARAMETERS_HPP_ER_2010
+#include <boost/parameter/parameters.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/detail/sequence_to_unpack_variadic.hpp>
+
+namespace boost{
+namespace parameter{
+namespace detail{
+
+ BOOST_DETAIL_MPL_SEQUENCE_TO_UNPACK_VARIADIC(
+ boost::parameter::parameters,
+ unpack_parameters,
+ 1,
+ 4,//BOOST_PARAMETER_MAX_ARITY-1,
+ boost::mpl::void_
+ );
+
+}// detail
+}// parameter
+}// boost
+
+#endif


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