Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59536 - in sandbox/SOC/2009/fusion/boost/fusion: . container/list/detail include sequence sequence/convenience sequence/intrinsic
From: mr.chr.schmidt_at_[hidden]
Date: 2010-02-06 18:19:44


Author: cschmidt
Date: 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
New Revision: 59536
URL: http://svn.boost.org/trac/boost/changeset/59536

Log:
adapt plain old array types & added sequence convenience functions (2)
Added:
   sandbox/SOC/2009/fusion/boost/fusion/include/convenience.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/copy.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/fill.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/generate.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/include/move.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/equal_to_impl.hpp | 3 +
   sandbox/SOC/2009/fusion/boost/fusion/include/swap.hpp | 3 +
   sandbox/SOC/2009/fusion/boost/fusion/sequence.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp | 4 +
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp | 5 +++
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp | 5 +++
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp | 8 +++++
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp | 21 ++++++++++++-
   sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp | 62 +--------------------------------------
   9 files changed, 48 insertions(+), 64 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/equal_to_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/equal_to_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/list/detail/equal_to_impl.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
+ 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,6 +9,8 @@
 #ifndef BOOST_FUSION_CONTAINER_LIST_DETAIL_EQUAL_TO_IMPL_HPP
 #define BOOST_FUSION_CONTAINER_LIST_DETAIL_EQUAL_TO_IMPL_HPP
 
+#include <boost/type_traits/is_same.hpp>
+
 namespace boost { namespace fusion { namespace extension
 {
     template <typename>

Added: sandbox/SOC/2009/fusion/boost/fusion/include/convenience.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/convenience.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2001-2007 Joel de Guzman
+
+ 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_INCLUDE_CONVENIENCE_HPP
+#define BOOST_FUSION_INCLUDE_CONVENIENCE_HPP
+
+#include <boost/fusion/sequence/convenience.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/copy.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/copy.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ 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_INCLUDE_COPY_HPP
+#define BOOST_FUSION_INCLUDE_COPY_HPP
+
+#include <boost/fusion/sequence/convenience/copy.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/fill.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/fill.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ 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_INCLUDE_FILL_HPP
+#define BOOST_FUSION_INCLUDE_FILL_HPP
+
+#include <boost/fusion/sequence/convenience/fill.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/generate.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/generate.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ 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_INCLUDE_GENERATE_HPP
+#define BOOST_FUSION_INCLUDE_GENERATE_HPP
+
+#include <boost/fusion/sequence/convenience/generate.hpp>
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/include/move.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/move.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ 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_INCLUDE_MOVE_HPP
+#define BOOST_FUSION_INCLUDE_MOVE_HPP
+
+#include <boost/fusion/sequence/convenience/move.hpp>
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/include/swap.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/include/swap.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/include/swap.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -1,5 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
+ 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)
@@ -8,6 +9,6 @@
 #ifndef BOOST_FUSION_INCLUDE_SWAP_HPP
 #define BOOST_FUSION_INCLUDE_SWAP_HPP
 
-#include <boost/fusion/sequence/intrinsic/swap.hpp>
+#include <boost/fusion/sequence/convenience/swap.hpp>
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -9,6 +9,7 @@
 #define BOOST_FUSION_SEQUENCE_HPP
 
 #include <boost/fusion/sequence/comparison.hpp>
+#include <boost/fusion/sequence/convenience.hpp>
 #include <boost/fusion/sequence/convert.hpp>
 #include <boost/fusion/sequence/intrinsic.hpp>
 #include <boost/fusion/sequence/io.hpp>

Added: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -0,0 +1,17 @@
+/*=============================================================================
+ 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_HPP
+#define BOOST_FUSION_SEQUENCE_CONVENIENCE_HPP
+
+#include <boost/fusion/sequence/convenience/copy.hpp>
+#include <boost/fusion/sequence/convenience/fill.hpp>
+#include <boost/fusion/sequence/convenience/generate.hpp>
+#include <boost/fusion/sequence/convenience/move.hpp>
+#include <boost/fusion/sequence/convenience/swap.hpp>
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/copy.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -10,8 +10,8 @@
 
 #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/algorithm/iteration/for_each.hpp>
 #include <boost/fusion/support/internal/ref.hpp>
 #include <boost/fusion/support/internal/assert.hpp>
 
@@ -36,7 +36,9 @@
         struct copy
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<From>));
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<To>));
 
             typedef void type;
         };

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/fill.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -8,6 +8,10 @@
 #ifndef BOOST_FUSION_SEQUENCE_CONVENIENCE_FILL_HPP
 #define BOOST_FUSION_SEQUENCE_CONVENIENCE_FILL_HPP
 
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+
 namespace boost { namespace fusion
 {
     namespace detail
@@ -36,6 +40,7 @@
         struct fill
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
 
             typedef void type;
         };

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -8,6 +8,10 @@
 #ifndef BOOST_FUSION_SEQUENCE_CONVENIENCE_GENERATE_HPP
 #define BOOST_FUSION_SEQUENCE_CONVENIENCE_GENERATE_HPP
 
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+
 namespace boost { namespace fusion
 {
     namespace detail
@@ -40,6 +44,7 @@
         struct generate
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq>));
 
             typedef void type;
         };

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -13,6 +13,12 @@
 # error "Your compiler must support rvalue reference in order to support moving."
 #endif
 
+#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/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+
 namespace boost { namespace fusion
 {
     namespace detail
@@ -35,7 +41,9 @@
         struct move
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<From>));
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<To>));
 
             typedef void type;
         };

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/swap.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -8,6 +8,15 @@
 #ifndef BOOST_FUSION_SEQUENCE_CONVENIENCE_SWAP_HPP
 #define BOOST_FUSION_SEQUENCE_CONVENIENCE_SWAP_HPP
 
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/algorithm/transformation/zip.hpp>
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/fusion/support/internal/assert.hpp>
+#ifdef BOOST_NO_RVALUE_REFERENCES
+# include <boost/ref.hpp>
+#endif
 #include <algorithm>
 
 namespace boost { namespace fusion
@@ -33,7 +42,9 @@
         struct swap
         {
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<From>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<From>));
             BOOST_FUSION_MPL_ASSERT((traits::is_sequence<To>));
+ BOOST_FUSION_MPL_ASSERT((traits::is_forward<To>));
 
             typedef void type;
         };
@@ -45,8 +56,14 @@
     {
         fusion::for_each(
             fusion::zip(
- BOOST_FUSION_FORWARD(From,from),
- BOOST_FUSION_FORWARD(To,to)),
+#ifdef BOOST_NO_RVALUE_REFERENCES
+ boost::ref(from),
+ boost::ref(to)
+#else
+ std::forward<From>(from),
+ std::forward<To>(to)
+#endif
+ ),
             detail::swapper());
     }
 }}

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp 2010-02-06 18:19:42 EST (Sat, 06 Feb 2010)
@@ -1,6 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
     Copyright (c) 2006 Dan Marsden
+ 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)
@@ -9,65 +10,6 @@
 #ifndef BOOST_FUSION_SEQUENCE_INTRINSIC_SWAP_HPP
 #define BOOST_FUSION_SEQUENCE_INTRINSIC_SWAP_HPP
 
-#include <boost/config.hpp>
-#ifdef BOOST_NO_RVALUE_REFERENCES
-# include <boost/fusion/container/generation/vector_tie.hpp>
-# include <boost/fusion/view/zip_view.hpp>
-# include <boost/fusion/algorithm/iteration/for_each.hpp>
-# include <boost/fusion/sequence/intrinsic/front.hpp>
-# include <boost/fusion/sequence/intrinsic/back.hpp>
-#endif
-#ifdef BOOST_FUSION_ENABLE_STATIC_ASSERTS
-# include <boost/fusion/sequence/intrinsic/size.hpp>
-#endif
-#include <boost/fusion/support/internal/assert.hpp>
-
-#include <algorithm>
-
-namespace boost { namespace fusion {
-#ifdef BOOST_NO_RVALUE_REFERENCES
- namespace detail
- {
- struct swap
- {
- typedef void result_type;
-
- template<typename Elem>
- void operator()(Elem const& e) const
- {
- std::swap(fusion::front(e), fusion::back(e));
- }
- };
- }
-#endif
-
- namespace result_of
- {
- template<typename Seq1, typename Seq2>
- struct swap
- {
- BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq1>));
- BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq1>));
- BOOST_FUSION_MPL_ASSERT((traits::is_sequence<Seq2>));
- BOOST_FUSION_MPL_ASSERT((traits::is_forward<Seq2>));
- BOOST_FUSION_STATIC_ASSERT((size<Seq1>::value==size<Seq2>::value));
-
- typedef void type;
- };
- }
-
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template<typename Seq1, typename Seq2>
- typename result_of::swap<Seq1&,Seq2&>::type
- swap(Seq1& seq1, Seq2& seq2)
- {
- for_each(zip_view<typename result_of::vector_tie<Seq1&,Seq2&>::type>(
- vector_tie(seq1, seq2))
- , detail::swap());
- }
-#else
- using std::swap;
-#endif
-}}
+#include <boost/fusion/sequence/convenience/swap.hpp>
 
 #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