diff options
Diffstat (limited to 'boost/mpl')
-rw-r--r-- | boost/mpl/aux_/insert_range_impl.hpp | 35 | ||||
-rw-r--r-- | boost/mpl/empty_base.hpp | 16 | ||||
-rw-r--r-- | boost/mpl/empty_sequence.hpp | 3 | ||||
-rw-r--r-- | boost/mpl/map/aux_/insert_range_impl.hpp | 41 | ||||
-rw-r--r-- | boost/mpl/map/aux_/item.hpp | 3 | ||||
-rw-r--r-- | boost/mpl/map/map0.hpp | 1 | ||||
-rw-r--r-- | boost/mpl/set/aux_/insert_range_impl.hpp | 41 | ||||
-rw-r--r-- | boost/mpl/set/aux_/item.hpp | 2 | ||||
-rw-r--r-- | boost/mpl/set/set0.hpp | 1 |
9 files changed, 120 insertions, 23 deletions
diff --git a/boost/mpl/aux_/insert_range_impl.hpp b/boost/mpl/aux_/insert_range_impl.hpp index baffb54a2d..fa4331562d 100644 --- a/boost/mpl/aux_/insert_range_impl.hpp +++ b/boost/mpl/aux_/insert_range_impl.hpp @@ -14,9 +14,10 @@ // $Date$ // $Revision$ -#include <boost/mpl/copy.hpp> +#include <boost/mpl/placeholders.hpp> +#include <boost/mpl/fold.hpp> +#include <boost/mpl/insert.hpp> #include <boost/mpl/clear.hpp> -#include <boost/mpl/front_inserter.hpp> #include <boost/mpl/joint_view.hpp> #include <boost/mpl/iterator_range.hpp> #include <boost/mpl/aux_/na_spec.hpp> @@ -43,29 +44,31 @@ struct insert_range_impl > struct apply #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) - : reverse_copy< - joint_view< + : reverse_fold< + joint_view< iterator_range<typename begin<Sequence>::type,Pos> - , joint_view< + , joint_view< Range , iterator_range<Pos,typename end<Sequence>::type> > > - , front_inserter< typename clear<Sequence>::type > + , typename clear<Sequence>::type + , insert<_1, begin<_1>, _2> > { #else { - typedef typename reverse_copy< - joint_view< - iterator_range<typename begin<Sequence>::type,Pos> - , joint_view< - Range - , iterator_range<Pos,typename end<Sequence>::type> - > - > - , front_inserter< typename clear<Sequence>::type > - >::type type; + typedef typename reverse_fold< + joint_view< + iterator_range<typename begin<Sequence>::type,Pos> + , joint_view< + Range + , iterator_range<Pos,typename end<Sequence>::type> + > + > + , typename clear<Sequence>::type + , insert<_1, begin<_1>, _2> + >::type type; #endif }; }; diff --git a/boost/mpl/empty_base.hpp b/boost/mpl/empty_base.hpp index a5841cf17a..cb56ef676c 100644 --- a/boost/mpl/empty_base.hpp +++ b/boost/mpl/empty_base.hpp @@ -17,12 +17,11 @@ #include <boost/mpl/bool.hpp> #include <boost/mpl/aux_/config/msvc.hpp> #include <boost/mpl/aux_/config/workaround.hpp> +#include <boost/mpl/aux_/lambda_support.hpp> +#include <boost/type_traits/integral_constant.hpp> #include <boost/type_traits/is_empty.hpp> -// should be always the last #include directive -#include <boost/type_traits/detail/bool_trait_def.hpp> - namespace boost { namespace mpl { // empty base class, guaranteed to have no members; inheritance from @@ -51,9 +50,14 @@ struct is_empty_base<empty_base> }} namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true) -} -#include <boost/type_traits/detail/bool_trait_undef.hpp> +template<> struct is_empty< mpl::empty_base > + : public ::boost::integral_constant<bool,true> +{ +public: + BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,is_empty,(mpl::empty_base)) +}; + +} #endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED diff --git a/boost/mpl/empty_sequence.hpp b/boost/mpl/empty_sequence.hpp index 94f5f5a387..f32cc6ee81 100644 --- a/boost/mpl/empty_sequence.hpp +++ b/boost/mpl/empty_sequence.hpp @@ -23,7 +23,8 @@ namespace boost { namespace mpl { struct empty_sequence { - struct tag; + struct tag; + typedef empty_sequence type; struct begin { typedef random_access_iterator_tag category; }; typedef begin end; }; diff --git a/boost/mpl/map/aux_/insert_range_impl.hpp b/boost/mpl/map/aux_/insert_range_impl.hpp new file mode 100644 index 0000000000..f1f0437c37 --- /dev/null +++ b/boost/mpl/map/aux_/insert_range_impl.hpp @@ -0,0 +1,41 @@ + +#ifndef BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED +#define BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED + +// Copyright Bruno Dutra 2015 +// +// 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +// $Id$ +// $Date$ +// $Revision$ + +#include <boost/mpl/insert_range_fwd.hpp> +#include <boost/mpl/map/aux_/tag.hpp> +#include <boost/mpl/placeholders.hpp> +#include <boost/mpl/fold.hpp> +#include <boost/mpl/insert.hpp> + +namespace boost { namespace mpl { + +template<> +struct insert_range_impl< aux::map_tag > +{ + template< + typename Sequence + , typename /*Pos*/ + , typename Range + > + struct apply + : fold<Range, Sequence, insert<_1, _2> > + { + }; +}; + +}} + +#endif // BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED diff --git a/boost/mpl/map/aux_/item.hpp b/boost/mpl/map/aux_/item.hpp index d0df522cd8..a0a98ca8b6 100644 --- a/boost/mpl/map/aux_/item.hpp +++ b/boost/mpl/map/aux_/item.hpp @@ -40,6 +40,7 @@ struct m_item typedef Key key_; typedef pair<Key,T> item; typedef Base base; + typedef m_item type; typedef typename next< typename Base::size >::type size; typedef typename next< typename Base::order >::type order; @@ -62,6 +63,7 @@ struct m_mask { typedef void_ key_; typedef Base base; + typedef m_mask type; typedef typename prior< typename Base::size >::type size; typedef typename x_order_impl<Base,Key>::type key_order_; @@ -123,6 +125,7 @@ struct m_mask { typedef void_ key_; typedef Base base; + typedef m_mask type; typedef typename prior< typename Base::size >::type size; typedef typename x_order_impl<Base,Key>::type key_order_; diff --git a/boost/mpl/map/map0.hpp b/boost/mpl/map/map0.hpp index e1ea897b21..88ed4b7c83 100644 --- a/boost/mpl/map/map0.hpp +++ b/boost/mpl/map/map0.hpp @@ -19,6 +19,7 @@ #include <boost/mpl/map/aux_/at_impl.hpp> //#include <boost/mpl/map/aux_/O1_size.hpp> #include <boost/mpl/map/aux_/insert_impl.hpp> +#include <boost/mpl/map/aux_/insert_range_impl.hpp> #include <boost/mpl/map/aux_/erase_impl.hpp> #include <boost/mpl/map/aux_/erase_key_impl.hpp> #include <boost/mpl/map/aux_/has_key_impl.hpp> diff --git a/boost/mpl/set/aux_/insert_range_impl.hpp b/boost/mpl/set/aux_/insert_range_impl.hpp new file mode 100644 index 0000000000..f7150a8714 --- /dev/null +++ b/boost/mpl/set/aux_/insert_range_impl.hpp @@ -0,0 +1,41 @@ + +#ifndef BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED +#define BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED + +// Copyright Bruno Dutra 2015 +// +// 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) +// +// See http://www.boost.org/libs/mpl for documentation. + +// $Id$ +// $Date$ +// $Revision$ + +#include <boost/mpl/insert_range_fwd.hpp> +#include <boost/mpl/set/aux_/tag.hpp> +#include <boost/mpl/placeholders.hpp> +#include <boost/mpl/fold.hpp> +#include <boost/mpl/insert.hpp> + +namespace boost { namespace mpl { + +template<> +struct insert_range_impl< aux::set_tag > +{ + template< + typename Sequence + , typename /*Pos*/ + , typename Range + > + struct apply + : fold<Range, Sequence, insert<_1, _2> > + { + }; +}; + +}} + +#endif // BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED diff --git a/boost/mpl/set/aux_/item.hpp b/boost/mpl/set/aux_/item.hpp index e90e4900f6..bd5bc953f4 100644 --- a/boost/mpl/set/aux_/item.hpp +++ b/boost/mpl/set/aux_/item.hpp @@ -33,6 +33,7 @@ struct s_item typedef void_ last_masked_; typedef T item_type_; typedef typename Base::item_ base; + typedef s_item type; typedef typename next< typename Base::size >::type size; typedef typename next< typename Base::order >::type order; @@ -57,6 +58,7 @@ struct s_mask typedef void_ item_type_; typedef typename Base::item_ base; typedef typename prior< typename Base::size >::type size; + typedef s_mask type; BOOST_MPL_AUX_SET_OVERLOAD( aux::yes_tag, IS_MASKED, s_mask, aux::type_wrapper<T>* ); }; diff --git a/boost/mpl/set/set0.hpp b/boost/mpl/set/set0.hpp index 8403731040..1c424e4646 100644 --- a/boost/mpl/set/set0.hpp +++ b/boost/mpl/set/set0.hpp @@ -21,6 +21,7 @@ #include <boost/mpl/set/aux_/size_impl.hpp> #include <boost/mpl/set/aux_/empty_impl.hpp> #include <boost/mpl/set/aux_/insert_impl.hpp> +#include <boost/mpl/set/aux_/insert_range_impl.hpp> #include <boost/mpl/set/aux_/erase_impl.hpp> #include <boost/mpl/set/aux_/erase_key_impl.hpp> #include <boost/mpl/set/aux_/has_key_impl.hpp> |