Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59233 - sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/joint_view
From: erwann.rogard_at_[hidden]
Date: 2010-01-22 19:48:59


Author: e_r
Date: 2010-01-22 19:48:58 EST (Fri, 22 Jan 2010)
New Revision: 59233
URL: http://svn.boost.org/trac/boost/changeset/59233

Log:
m
Text files modified:
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/joint_view/binder_iterator.hpp | 63 +++++++++++++--------------------------
   1 files changed, 22 insertions(+), 41 deletions(-)

Modified: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/joint_view/binder_iterator.hpp
==============================================================================
--- sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/joint_view/binder_iterator.hpp (original)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/joint_view/binder_iterator.hpp 2010-01-22 19:48:58 EST (Fri, 22 Jan 2010)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// statistics::detail::fusion::joint_view::binder_iterator.hpp //
+// statistics::detail::fusion::joint_view::bind_iterator.hpp //
 // //
 // Copyright 2009 Erwann Rogard. Distributed under the Boost //
 // Software License, Version 1.0. (See accompanying file //
@@ -8,63 +8,44 @@
 #ifndef BOOST_STATISTICS_DETAIL_FUSION_JOINT_VIEW_BINDER_ITERATOR_HPP_ER_2009
 #define BOOST_STATISTICS_DETAIL_FUSION_JOINT_VIEW_BINDER_ITERATOR_HPP_ER_2009
 #include <boost/utility/result_of.hpp>
+#include <boost/range.hpp>
 #include <boost/type_traits/add_const.hpp>
 #include <boost/type_traits/add_reference.hpp>
 #include <boost/iterator/iterator_traits.hpp>
 #include <boost/iterator/transform_iterator.hpp>
-#include <boost/statistics/detail/fusion/joint_view/binder.hpp>
 
 namespace boost{
 namespace statistics{
 namespace detail{
 namespace fusion{
 namespace joint_view{
+namespace result_of{
 
- template<typename Binder, bool is_left = true>
- struct binder_iterator
+ // e.g Binder = joint_view::binder<>
+ template<typename Binder,typename It>
+ struct bind_iterator
     {
- typedef Binder binder_;
-
- template<typename It>
- struct apply{
- typedef typename iterator_value<It>::type seq2_;
- typedef typename boost::add_const<seq2_>::type c_;
- typedef typename boost::add_reference<c_>::type cref_;
- typedef typename boost::result_of<binder_(cref_)>::type res_;
- typedef boost::function<res_(cref_)> fun_;
- typedef boost::transform_iterator<fun_,It> type;
- static type call(const binder_& binder,It it)
- {
- return type(it,binder);
- }
-
- typedef boost::iterator_range<type> range_type;
- static range_type call(const binder_& binder,It b,It e){
- return range_type(
- call(binder,b),
- call(binder,e)
- );
- }
-
- };
+ typedef typename iterator_value<It>::type seq2_;
+ typedef typename boost::add_const<seq2_>::type c_;
+ typedef typename boost::add_reference<c_>::type cref_;
+ typedef typename boost::result_of<binder_(cref_)>::type res_;
+ typedef boost::function<res_(cref_)> fun_;
+ typedef boost::transform_iterator<fun_,It> type;
+ static type call(const binder_& binder,It it)
+ {
+ return type(it,binder);
+ }
     };
-
- template<typename Binder,typename It>
- typename binder_iterator<Binder>::template apply<It>::type
- make_binder_iterator(const Binder& binder,It it)
- {
- typedef binder_iterator<Binder> meta_;
- return meta_::template apply<It>::call(binder,it);
- }
+
+}
 
     template<typename Binder,typename It>
- typename binder_iterator<Binder>::template apply<It>::range_type
- make_binder_range(const Binder& binder,It b,It e)
+ typename detail::joint_view::result_of::bind_iterator<Binder,It>::type
+ bind_iterator(const Binder& binder,It it)
     {
- typedef binder_iterator<Binder> meta_;
- return meta_::template apply<It>::call(binder,b,e);
+ typedef detail::joint_view::result_of::bind_iterator<Binder,It> meta_;
+ return meta_::call(binder,it);
     }
-
     
 }// joint_view
 }// fusion


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