Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59534 - in sandbox/SOC/2009/fusion/boost/fusion: adapted adapted/detail/array adapted/detail/po_array sequence/convenience support support/internal
From: mr.chr.schmidt_at_[hidden]
Date: 2010-02-06 17:25:37


Author: cschmidt
Date: 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
New Revision: 59534
URL: http://svn.boost.org/trac/boost/changeset/59534

Log:
adapt plain old array types & added sequence convenience functions
Added:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/at_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/begin_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/category_of_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/deref_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/end_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_sequence_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_view_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/size_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/tag_of.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_at_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_of_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/array.hpp | 18 +++++++
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/size_impl.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp | 84 +++++++++++++++------------------------
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp | 1
   4 files changed, 50 insertions(+), 55 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/array.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/array.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/array.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -1,5 +1,5 @@
 /*=============================================================================
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-2010 Christopher Schmidt
 
     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)
@@ -8,7 +8,21 @@
 #ifndef BOOST_FUSION_ADAPTED_ARRAY_HPP
 #define BOOST_FUSION_ADAPTED_ARRAY_HPP
 
+//for backwards compatibility
 #include <boost/fusion/adapted/boost_array.hpp>
-#include <boost/fusion/adapted/std_array.hpp>
+
+#include <boost/fusion/support/internal/ref.hpp>
+
+#include <boost/fusion/adapted/detail/po_array/tag_of.hpp>
+#include <boost/fusion/adapted/detail/po_array/is_view_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/is_sequence_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/category_of_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/begin_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/end_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/size_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/at_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/value_at_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/deref_impl.hpp>
+#include <boost/fusion/adapted/detail/po_array/value_of_impl.hpp>
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/size_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/size_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/size_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -9,6 +9,8 @@
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_ARRAY_SIZE_IMPL_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_ARRAY_SIZE_IMPL_HPP
 
+#include <boost/mpl/int.hpp>
+
 namespace boost { namespace fusion { namespace extension
 {
     template<typename>

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/at_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/at_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,41 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_AT_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_AT_IMPL_HPP
+
+#include <boost/type_traits/remove_extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct at_impl;
+
+ template<>
+ struct at_impl<po_array_tag>
+ {
+ template<typename Seq, typename N>
+ struct apply
+ {
+ typedef typename
+ detail::add_lref<
+ typename remove_extent<
+ typename detail::remove_reference<Seq>::type
+ >::type
+ >::type
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return seq[N::value];
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/begin_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/begin_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,42 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_BEGIN_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_BEGIN_IMPL_HPP
+
+#include <boost/fusion/iterator/basic_iterator.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct begin_impl;
+
+ template <>
+ struct begin_impl<po_array_tag>
+ {
+ template <typename Seq>
+ struct apply
+ {
+ typedef
+ basic_iterator<
+ po_array_iterator_tag
+ , random_access_traversal_tag
+ , typename detail::add_lref<Seq>::type
+ , 0
+ >
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return type(seq,0);
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/category_of_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/category_of_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,32 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_CATEGORY_OF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_CATEGORY_OF_IMPL_HPP
+
+namespace boost { namespace fusion
+{
+ struct random_access_traversal_tag;
+
+ namespace extension
+ {
+ template<typename>
+ struct category_of_impl;
+
+ template<>
+ struct category_of_impl<po_array_tag>
+ {
+ template<typename Seq>
+ struct apply
+ {
+ typedef random_access_traversal_tag type;
+ };
+ };
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/deref_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/deref_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,45 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_DEREF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_DEREF_IMPL_HPP
+
+#include <boost/type_traits/remove_extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct deref_impl;
+
+ template <>
+ struct deref_impl<po_array_iterator_tag>
+ {
+ template <typename It>
+ struct apply
+ {
+ typedef typename detail::remove_reference<It>::type it;
+
+ typedef typename
+ detail::add_lref<
+ typename remove_extent<
+ typename detail::remove_reference<
+ typename it::seq_type
+ >::type
+ >::type
+ >::type
+ type;
+
+ static type
+ call(It it)
+ {
+ return (*it.seq)[it::index::value];
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/end_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/end_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,46 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_END_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_END_IMPL_HPP
+
+#include <boost/fusion/iterator/basic_iterator.hpp>
+#include <boost/type_traits/rank.hpp>
+#include <boost/type_traits/extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct end_impl;
+
+ template <>
+ struct end_impl<po_array_tag>
+ {
+ template <typename Seq>
+ struct apply
+ {
+ typedef typename detail::remove_reference<Seq>::type seq;
+
+ typedef
+ basic_iterator<
+ po_array_iterator_tag
+ , random_access_traversal_tag
+ , typename detail::add_lref<Seq>::type
+ , extent<seq,rank<seq>::value>::value
+ >
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return type(seq,0);
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_sequence_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_sequence_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_IS_SEQUENCE_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_IS_SEQUENCE_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct is_sequence_impl;
+
+ template<>
+ struct is_sequence_impl<po_array_tag>
+ {
+ template<typename Seq>
+ struct apply
+ : mpl::true_
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_view_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/is_view_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_IS_VIEW_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_IS_VIEW_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct is_view_impl;
+
+ template<>
+ struct is_view_impl<po_array_tag>
+ {
+ template<typename Seq>
+ struct apply
+ : mpl::false_
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/size_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/size_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,32 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_SIZE_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_SIZE_IMPL_HPP
+
+#include <boost/type_traits/rank.hpp>
+#include <boost/type_traits/extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct size_impl;
+
+ template<>
+ struct size_impl<po_array_tag>
+ {
+ template<typename Seq>
+ struct apply
+ {
+ typedef typename detail::remove_reference<Seq>::type seq;
+
+ typedef typename extent<seq,rank<seq>::value>::type type;
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/tag_of.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/tag_of.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,74 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_TAG_OF_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_TAG_OF_HPP
+
+#include <boost/fusion/support/tag_of_fwd.hpp>
+#include <boost/fusion/support/category_of.hpp>
+#include <cstddef>
+
+namespace boost
+{
+ namespace fusion
+ {
+ struct po_array_tag;
+ struct po_array_iterator_tag;
+ struct random_access_traversal_tag;
+ struct fusion_sequence_tag;
+
+ namespace traits
+ {
+#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
+# define BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(TYPE)\
+ template<typename T, std::size_t N>\
+ struct tag_of<TYPE, void>\
+ {\
+ typedef po_array_tag type;\
+ };
+#else
+# define BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(TYPE)\
+ template<typename T, std::size_t N>\
+ struct tag_of<TYPE>\
+ {\
+ typedef po_array_tag type;\
+ };
+#endif
+
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T[N]);
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T const[N]);
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T(&)[N]);
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T const(&)[N]);
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T(&&)[N]);
+ BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION(T const(&&)[N]);
+#endif
+
+#undef BOOST_FUSION_ARRAY_TAG_OF_SPECIALIZATION
+ }
+ }
+
+ namespace mpl
+ {
+ template<typename>
+ struct sequence_tag;
+
+ template<typename T, std::size_t N>
+ struct sequence_tag<T[N]>
+ {
+ typedef fusion::po_array_tag type;
+ };
+
+ template<typename T, std::size_t N>
+ struct sequence_tag<T const[N] >
+ {
+ typedef fusion::po_array_tag type;
+ };
+ }
+}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_at_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_at_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_VALUE_AT_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_VALUE_AT_IMPL_HPP
+
+#include <boost/type_traits/remove_extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct value_at_impl;
+
+ template <>
+ struct value_at_impl<po_array_tag>
+ {
+ template <typename Seq, typename N>
+ struct apply
+ : remove_extent<typename detail::remove_reference<Seq>::type>
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_of_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/po_array/value_of_impl.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,32 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_ADAPTED_DETAIL_PO_ARRAY_VALUE_OF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_PO_ARRAY_VALUE_OF_IMPL_HPP
+
+#include <boost/type_traits/remove_extent.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct value_of_impl;
+
+ template <>
+ struct value_of_impl<po_array_iterator_tag>
+ {
+ template <typename It>
+ struct apply
+ : remove_extent<
+ typename detail::remove_reference<
+ typename detail::remove_reference<It>::type::seq_type
+ >::type
+ >
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,55 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_SEQUENCE_CONVENIENCE_COPY_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_COPY_HPP
+
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/algorithm/transformation/zip.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ struct copier
+ {
+ template<class ZippedElements>
+ void
+ operator()(ZippedElements const& zipped_elements)const
+ {
+ fusion::back(zipped_elements)=fusion::front(zipped_elements);
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename From, typename To>
+ struct copy
+ {
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+
+ typedef void type;
+ };
+ }
+
+ template<typename From, typename To>
+ typename result_of::copy<BOOST_FUSION_R_ELSE_CLREF(From),To&>::type
+ copy(BOOST_FUSION_R_ELSE_CLREF(From) from,To& to)
+ {
+ fusion::for_each(
+ fusion::zip(BOOST_FUSION_FORWARD(From,from),to),
+ detail::copier());
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,52 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_SEQUENCE_CONVENIENCE_FILL_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_FILL_HPP
+
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ template<class TRef>
+ struct filler
+ {
+ TRef t;
+
+ filler(TRef t)
+ : t(t)
+ {}
+
+ template<class Element>
+ void
+ operator()(Element& element)const
+ {
+ element=t;
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename Seq, typename T>
+ struct fill
+ {
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+
+ typedef void type;
+ };
+ }
+
+ template<typename Seq, typename T>
+ typename result_of::fill<BOOST_FUSION_R_ELSE_LREF(Seq),T const&>::type
+ fill(BOOST_FUSION_R_ELSE_LREF(Seq) seq,T const& t)
+ {
+ fusion::for_each(seq,detail::filler<T const&>(t));
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,62 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_SEQUENCE_CONVENIENCE_GENERATE_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_GENERATE_HPP
+
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ template<class F>
+ struct generator
+ {
+ F f;
+
+ generator(F f)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ : f(f)
+#else
+ : f(std::move(f))
+#endif
+ {}
+
+ template<class Element>
+ void
+ operator()(Element& element)const
+ {
+ element=f();
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename Seq, typename F>
+ struct generate
+ {
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+
+ typedef void type;
+ };
+ }
+
+ template<typename Seq, typename F>
+ typename result_of::generate<
+ BOOST_FUSION_R_ELSE_LREF(Seq)
+ , BOOST_FUSION_RREF_ELSE_OBJ(F)
+ >::type
+ generate(BOOST_FUSION_R_ELSE_LREF(Seq) seq,BOOST_FUSION_RREF_ELSE_OBJ(F) f)
+ {
+ fusion::for_each(
+ seq,
+ detail::generator<BOOST_FUSION_R_ELSE_OBJ(F)>(
+ BOOST_FUSION_FORWARD(F,f)));
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,52 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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_SEQUENCE_CONVENIENCE_MOVE_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_MOVE_HPP
+
+#include <boost/config.hpp>
+#ifdef BOOST_NO_RVALUE_REFERENCES
+# error "Your compiler must support rvalue reference in order to support moving."
+#endif
+
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ struct move
+ {
+ template<class ZippedElements>
+ void
+ operator()(ZippedElements const& zipped_elements)const
+ {
+ fusion::back(zipped_elements)=
+ std::move(fusion::front(zipped_elements));
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename From, typename To>
+ struct move
+ {
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+
+ typedef void type;
+ };
+ }
+
+ template<typename From, typename To>
+ typename result_of::move<From&,To&>::type
+ move(From& from,To& to)
+ {
+ fusion::for_each(fusion::zip(from,to),detail::mover());
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,54 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidts
+
+ 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_SEQUENCE_CONVENIENCE_SWAP_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_SWAP_HPP
+
+#include <algorithm>
+
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ struct swapper
+ {
+ template<class ZippedElements>
+ void
+ operator()(ZippedElements const& zipped_elements)const
+ {
+ using std::swap;
+ swap(fusion::front(zipped_elements),
+ fusion::back(zipped_elements));
+ }
+ };
+ }
+
+ namespace result_of
+ {
+ template<typename From, typename To>
+ struct swap
+ {
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+
+ typedef void type;
+ };
+ }
+
+ template<typename From, typename To>
+ typename result_of::swap<From&,To&>::type
+ swap(BOOST_FUSION_R_ELSE_LREF(From) from,BOOST_FUSION_R_ELSE_LREF(To) to)
+ {
+ fusion::for_each(
+ fusion::zip(
+ BOOST_FUSION_FORWARD(From,from),
+ BOOST_FUSION_FORWARD(To,to)),
+ detail::swapper());
+ }
+}}
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -1,6 +1,6 @@
 /*=============================================================================
     Copyright (c) 2007 Tobias Schwinger
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-2010 Christopher Schmidt
 
     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)
@@ -36,7 +36,7 @@
             typedef T& type;
         };
 
-#define BOOST_FUSION_CV_REF_SPECIALIZATION(MODIFIER,_)\
+#define BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION(MODIFIER,_)\
         template <typename T>\
         struct deduce<T MODIFIER>\
         {\
@@ -61,63 +61,43 @@
             typedef T& type;\
         };
 
- BOOST_FUSION_CV_REF_SPECIALIZATION(volatile&,_)
- BOOST_FUSION_CV_REF_SPECIALIZATION(const volatile&,_)
+ BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION(volatile&,_)
+ BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION(const volatile&,_)
 #ifndef BOOST_NO_RVALUE_REFERENCES
- BOOST_FUSION_CV_REF_SPECIALIZATION(volatile&&,_)
- BOOST_FUSION_CV_REF_SPECIALIZATION(const volatile&&,_)
+ BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION(volatile&&,_)
+ BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION(const volatile&&,_)
 #endif
- BOOST_FUSION_ALL_CV_REF_COMBINATIONS(BOOST_FUSION_CV_REF_SPECIALIZATION,_)
+ BOOST_FUSION_ALL_CV_REF_COMBINATIONS(BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION,_)
 
-#undef BOOST_FUSION_CV_REF_SPECIALIZATION
+#undef BOOST_FUSION_DEDUCE_CV_REF_SPECIALIZATION
 
- template <typename T, int N>
- struct deduce<T[N]>
- {
- typedef const T(&type)[N];
- };
-
- template <typename T, int N>
- struct deduce<const T[N]>
- {
- typedef const T(&type)[N];
- };
-
- template <typename T, int N>
- struct deduce<volatile T[N]>
- {
- typedef const volatile T(&type)[N];
- };
-
- template <typename T, int N>
- struct deduce<const volatile T[N]>
- {
- typedef const volatile T(&type)[N];
- };
-
- template <typename T, int N>
- struct deduce<T(&)[N]>
- {
- typedef T(&type)[N];
+#define BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(MODIFIER1,MODIFIER2,MODIFIER3)\
+ template <typename T, int N>\
+ struct deduce<T MODIFIER1[N]>\
+ {\
+ typedef T MODIFIER2(MODIFIER3 type)[N];\
         };
 
- template <typename T, int N>
- struct deduce<const T(&)[N]>
- {
- typedef const T(&type)[N];
- };
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(
+ BOOST_PP_EMPTY(),BOOST_PP_EMPTY(),&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(const,const,&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(volatile,volatile,&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(
+ const volatile,const volatile,&);
+
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION((&),BOOST_PP_EMPTY(),&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(const(&),const,&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(volatile(&),volatile,&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(
+ const volatile(&),const volatile,&);
 
- template <typename T, int N>
- struct deduce<volatile T(&)[N]>
- {
- typedef volatile T(&type)[N];
- };
-
- template <typename T, int N>
- struct deduce<const volatile T(&)[N]>
- {
- typedef const volatile T(&type)[N];
- };
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION((&&),BOOST_PP_EMPTY(),&&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(const(&&),const,&&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(volatile(&&),volatile,&&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(
+ const volatile(&&),const volatile,&&);
+#endif
     }
 
     namespace detail

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp 2010-02-06 17:25:35 EST (Sat, 06 Feb 2010)
@@ -22,7 +22,6 @@
 #include <boost/type_traits/is_class.hpp>
 #include <boost/type_traits/is_array.hpp>
 #include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/add_reference.hpp>
 #include <boost/type_traits/add_const.hpp>
 #ifndef BOOST_FUSION_NO_PROPAGATE_VOLATILE
 # include <boost/type_traits/is_volatile.hpp>


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