Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71809 - in sandbox/coerce/boost/coerce: . detail
From: vexocide_at_[hidden]
Date: 2011-05-08 07:03:36


Author: vexocide
Date: 2011-05-08 07:03:35 EDT (Sun, 08 May 2011)
New Revision: 71809
URL: http://svn.boost.org/trac/boost/changeset/71809

Log:
Simplification of the backend selector
Text files modified:
   sandbox/coerce/boost/coerce/coerce.hpp | 7 ++++++-
   sandbox/coerce/boost/coerce/detail/backend.hpp | 19 +++++--------------
   sandbox/coerce/boost/coerce/detail/qi.hpp | 1 -
   3 files changed, 11 insertions(+), 16 deletions(-)

Modified: sandbox/coerce/boost/coerce/coerce.hpp
==============================================================================
--- sandbox/coerce/boost/coerce/coerce.hpp (original)
+++ sandbox/coerce/boost/coerce/coerce.hpp 2011-05-08 07:03:35 EDT (Sun, 08 May 2011)
@@ -12,6 +12,8 @@
 #endif
 
 #include <boost/coerce/detail/backend.hpp>
+#include <boost/coerce/detail/push_back.hpp>
+#include <boost/range/has_range_iterator.hpp>
 
 #include <typeinfo> // for std::bad_cast
 
@@ -21,7 +23,10 @@
 
         template <typename Target, typename Source, typename Enable = void>
         struct as
- : detail::backend<Target, Source>::type { };
+ : detail::backend<
+ typename detail::has_push_back<Target>::type,
+ typename has_range_const_iterator<Source>::type
+ >::type { };
 
     } // namespace traits
 

Modified: sandbox/coerce/boost/coerce/detail/backend.hpp
==============================================================================
--- sandbox/coerce/boost/coerce/detail/backend.hpp (original)
+++ sandbox/coerce/boost/coerce/detail/backend.hpp 2011-05-08 07:03:35 EDT (Sun, 08 May 2011)
@@ -12,37 +12,28 @@
 #endif
 
 #include <boost/coerce/detail/karma.hpp>
-#include <boost/coerce/detail/push_back.hpp>
 #include <boost/coerce/detail/qi.hpp>
 
 #include <boost/mpl/bool.hpp>
-#include <boost/range/has_range_iterator.hpp>
 #include <boost/static_assert.hpp>
 
 namespace boost { namespace coerce { namespace detail {
 
     template <typename U, typename V>
- struct backend_impl {
+ struct backend {
         BOOST_STATIC_ASSERT(sizeof(U) == 0);
     };
 
     template <typename U>
- struct backend_impl<U, mpl::true_> {
- typedef detail::qi type;
+ struct backend<U, mpl::true_> {
+ typedef qi type;
     };
 
     template <>
- struct backend_impl<mpl::true_, mpl::false_> {
- typedef detail::karma type;
+ struct backend<mpl::true_, mpl::false_> {
+ typedef karma type;
     };
 
- template <typename Target, typename Source, typename Enable = void>
- struct backend
- : backend_impl<
- typename detail::has_push_back<Target>::type,
- typename has_range_const_iterator<Source>::type
- > { };
-
 } } } // namespace boost::coerce::detail
 
 #endif // BOOST_COERCE_DETAIL_BACKEND_HPP

Modified: sandbox/coerce/boost/coerce/detail/qi.hpp
==============================================================================
--- sandbox/coerce/boost/coerce/detail/qi.hpp (original)
+++ sandbox/coerce/boost/coerce/detail/qi.hpp 2011-05-08 07:03:35 EDT (Sun, 08 May 2011)
@@ -16,7 +16,6 @@
 #include <boost/range/begin.hpp>
 #include <boost/range/const_iterator.hpp>
 #include <boost/range/end.hpp>
-#include <boost/range/has_range_iterator.hpp>
 #include <boost/range/size.hpp>
 #include <boost/spirit/home/qi/auto.hpp>
 #include <boost/spirit/home/qi/char.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