Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68225 - in trunk/boost/fusion/sequence/comparison: . detail
From: joel_at_[hidden]
Date: 2011-01-18 07:49:02


Author: djowel
Date: 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
New Revision: 68225
URL: http://svn.boost.org/trac/boost/changeset/68225

Log:
- hoisted enable_equality, enable_comparison and is_native_fusion_sequence to fusion::traits namespace
- added SFINAE-enable
(http://article.gmane.org/gmane.comp.parsers.spirit.devel/3902)
Added:
   trunk/boost/fusion/sequence/comparison/enable_comparison.hpp (contents, props changed)
Removed:
   trunk/boost/fusion/sequence/comparison/detail/enable_comparison.hpp
Text files modified:
   trunk/boost/fusion/sequence/comparison/equal_to.hpp | 6 +++---
   trunk/boost/fusion/sequence/comparison/greater.hpp | 6 +++---
   trunk/boost/fusion/sequence/comparison/greater_equal.hpp | 6 +++---
   trunk/boost/fusion/sequence/comparison/less.hpp | 6 +++---
   trunk/boost/fusion/sequence/comparison/less_equal.hpp | 10 +++++-----
   trunk/boost/fusion/sequence/comparison/not_equal_to.hpp | 6 +++---
   6 files changed, 20 insertions(+), 20 deletions(-)

Deleted: trunk/boost/fusion/sequence/comparison/detail/enable_comparison.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/detail/enable_comparison.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
+++ (empty file)
@@ -1,41 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2006 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)
-==============================================================================*/
-#if !defined(FUSION_ENABLE_COMPARISON_09232005_1958)
-#define FUSION_ENABLE_COMPARISON_09232005_1958
-
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/fusion/support/sequence_base.hpp>
-#include <boost/fusion/support/is_sequence.hpp>
-#include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
-namespace boost { namespace fusion { namespace detail
-{
- template <typename Sequence>
- struct is_native_fusion_sequence
- : is_convertible<Sequence, detail::from_sequence_convertible_type>
- {};
-
- template <typename Seq1, typename Seq2>
- struct enable_equality
- : mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
- {};
-
- template <typename Seq1, typename Seq2>
- struct enable_comparison
- : mpl::and_<
- mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
- , mpl::equal_to<result_of::size<Seq1>, result_of::size<Seq2> >
- >
- {};
-
-}}}
-
-#endif

Added: trunk/boost/fusion/sequence/comparison/enable_comparison.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/fusion/sequence/comparison/enable_comparison.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -0,0 +1,40 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+#if !defined(FUSION_ENABLE_COMPARISON_09232005_1958)
+#define FUSION_ENABLE_COMPARISON_09232005_1958
+
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+
+namespace boost { namespace fusion { namespace traits
+{
+ template <typename Sequence, typename Enable = void>
+ struct is_native_fusion_sequence
+ : is_convertible<Sequence, detail::from_sequence_convertible_type>
+ {};
+
+ template <typename Seq1, typename Seq2, typename Enable = void>
+ struct enable_equality
+ : mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
+ {};
+
+ template <typename Seq1, typename Seq2, typename Enable = void>
+ struct enable_comparison
+ : mpl::and_<
+ mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
+ , mpl::equal_to<result_of::size<Seq1>, result_of::size<Seq2> >
+ >
+ {};
+}}}
+
+#endif

Modified: trunk/boost/fusion/sequence/comparison/equal_to.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/equal_to.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/equal_to.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_EQUAL_TO_05052005_0431)
@@ -12,7 +12,7 @@
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
 #include <boost/fusion/sequence/comparison/detail/equal_to.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 #include <boost/config.hpp>
 
 #if defined (BOOST_MSVC)
@@ -38,7 +38,7 @@
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_equality<Seq1, Seq2>
+ traits::enable_equality<Seq1, Seq2>
               , bool
>::type
         operator==(Seq1 const& a, Seq2 const& b)

Modified: trunk/boost/fusion/sequence/comparison/greater.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/greater.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/greater.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_GREATER_05052005_0432)
@@ -11,7 +11,7 @@
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 
 #if defined(FUSION_DIRECT_OPERATOR_USAGE)
 #include <boost/fusion/sequence/comparison/detail/greater.hpp>
@@ -38,7 +38,7 @@
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_comparison<Seq1, Seq2>
+ traits::enable_comparison<Seq1, Seq2>
               , bool
>::type
         operator>(Seq1 const& a, Seq2 const& b)

Modified: trunk/boost/fusion/sequence/comparison/greater_equal.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/greater_equal.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/greater_equal.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_GREATER_EQUAL_05052005_0432)
@@ -11,7 +11,7 @@
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 
 #if defined(FUSION_DIRECT_OPERATOR_USAGE)
 #include <boost/fusion/sequence/comparison/detail/greater_equal.hpp>
@@ -38,7 +38,7 @@
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_comparison<Seq1, Seq2>
+ traits::enable_comparison<Seq1, Seq2>
               , bool
>::type
         operator>=(Seq1 const& a, Seq2 const& b)

Modified: trunk/boost/fusion/sequence/comparison/less.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/less.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/less.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_LESS_05052005_0432)
@@ -12,7 +12,7 @@
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
 #include <boost/fusion/sequence/comparison/detail/less.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 
 namespace boost { namespace fusion
 {
@@ -29,7 +29,7 @@
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_comparison<Seq1, Seq2>
+ traits::enable_comparison<Seq1, Seq2>
               , bool
>::type
         operator<(Seq1 const& a, Seq2 const& b)

Modified: trunk/boost/fusion/sequence/comparison/less_equal.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/less_equal.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/less_equal.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_LESS_EQUAL_05052005_0432)
@@ -11,7 +11,7 @@
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 
 #if defined(FUSION_DIRECT_OPERATOR_USAGE)
 #include <boost/fusion/sequence/comparison/detail/less_equal.hpp>
@@ -35,7 +35,7 @@
 
     namespace operators
     {
-#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400)
+#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400)
 // Workaround for VC8.0 and VC7.1
         template <typename Seq1, typename Seq2>
         inline bool
@@ -60,12 +60,12 @@
 
 #else
 // Somehow VC8.0 and VC7.1 does not like this code
-// but barfs somewhere else.
+// but barfs somewhere else.
 
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_comparison<Seq1, Seq2>
+ traits::enable_comparison<Seq1, Seq2>
               , bool
>::type
         operator<=(Seq1 const& a, Seq2 const& b)

Modified: trunk/boost/fusion/sequence/comparison/not_equal_to.hpp
==============================================================================
--- trunk/boost/fusion/sequence/comparison/not_equal_to.hpp (original)
+++ trunk/boost/fusion/sequence/comparison/not_equal_to.hpp 2011-01-18 07:49:01 EST (Tue, 18 Jan 2011)
@@ -2,7 +2,7 @@
     Copyright (c) 1999-2003 Jaakko Jarvi
     Copyright (c) 2001-2006 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #if !defined(FUSION_NOT_EQUAL_TO_05052005_0431)
@@ -11,7 +11,7 @@
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/sequence/intrinsic/end.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>
-#include <boost/fusion/sequence/comparison/detail/enable_comparison.hpp>
+#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
 
 #if defined(FUSION_DIRECT_OPERATOR_USAGE)
 #include <boost/fusion/sequence/comparison/detail/not_equal_to.hpp>
@@ -41,7 +41,7 @@
         template <typename Seq1, typename Seq2>
         inline typename
             enable_if<
- detail::enable_equality<Seq1, Seq2>
+ traits::enable_equality<Seq1, Seq2>
               , bool
>::type
         operator!=(Seq1 const& a, Seq2 const& b)


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