Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56893 - in sandbox/statistics/detail/fusion: boost/statistics/detail/fusion/at_key boost/statistics/detail/fusion/functor boost/statistics/detail/fusion/map libs/statistics/detail/fusion/example
From: erwann.rogard_at_[hidden]
Date: 2009-10-16 00:49:04


Author: e_r
Date: 2009-10-16 00:49:03 EDT (Fri, 16 Oct 2009)
New Revision: 56893
URL: http://svn.boost.org/trac/boost/changeset/56893

Log:
a/m
Added:
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/map/
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/map/identity_f.h (contents, props changed)
Text files modified:
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/at_key/iterator.hpp | 4 ++--
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/functor/map_identity_f.hpp | 3 ---
   sandbox/statistics/detail/fusion/libs/statistics/detail/fusion/example/at_key.cpp | 2 +-
   3 files changed, 3 insertions(+), 6 deletions(-)

Modified: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/at_key/iterator.hpp
==============================================================================
--- sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/at_key/iterator.hpp (original)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/at_key/iterator.hpp 2009-10-16 00:49:03 EDT (Fri, 16 Oct 2009)
@@ -11,7 +11,7 @@
 #include <boost/utility/result_of.hpp>
 #include <boost/iterator/transform_iterator.hpp>
 #include <boost/iterator/iterator_traits.hpp>
-#include <boost/statistics/detail/fusion/functor/at_key.hpp>
+#include <boost/statistics/detail/fusion/at_key/functor.hpp>
 
 namespace boost{
 namespace statistics{
@@ -22,7 +22,7 @@
     template<typename It,typename K>
     struct meta_iterator
     {
- typedef statistics::detail::fusion::functor::at_key<K> f_;
+ typedef statistics::detail::fusion::at_key::functor<K> f_;
         typedef typename iterator_reference<It>::type ref1_;
         
         // See boost.user mailing list

Modified: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/functor/map_identity_f.hpp
==============================================================================
--- sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/functor/map_identity_f.hpp (original)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/functor/map_identity_f.hpp 2009-10-16 00:49:03 EDT (Fri, 16 Oct 2009)
@@ -9,10 +9,7 @@
 #ifndef BOOST_STATISTICS_DETAIL_FUSION_MAP_IDENTITY_F_HPP_ER_2009
 #define BOOST_STATISTICS_DETAIL_FUSION_MAP_IDENTITY_F_HPP_ER_2009
 #include <boost/utility/result_of.hpp>
-
 #include <boost/fusion/include/pair.hpp>
-
-
 #include <boost/fusion/container/map.hpp>
 #include <boost/fusion/include/map.hpp>
 #include <boost/fusion/include/map_fwd.hpp>

Added: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/map/identity_f.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/map/identity_f.h 2009-10-16 00:49:03 EDT (Fri, 16 Oct 2009)
@@ -0,0 +1,114 @@
+//////////////////////////////////////////////////////////////////////////////
+// detail::fusion::functor::identity_f.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_FUSION_MAP_IDENTITY_F_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_FUSION_MAP_IDENTITY_F_HPP_ER_2009
+#include <boost/utility/result_of.hpp>
+
+#include <boost/fusion/include/pair.hpp>
+
+
+#include <boost/fusion/container/map.hpp>
+#include <boost/fusion/include/map.hpp>
+#include <boost/fusion/include/map_fwd.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/include/at_key.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace fusion{
+namespace map{
+
+ template<typename K1,typename K2,typename F>
+ class identity_f{
+
+ public:
+
+ struct identity
+ {
+ typedef K1 key_;
+ template<typename X>
+ struct apply{
+ typedef boost::fusion::pair<K1,X> pair_;
+ };
+ };
+
+ struct function
+ {
+ typedef K2 key_;
+
+ template<typename X>
+ struct apply{
+ typedef typename boost::result_of<F(const X&)>::type cr_data2_;
+ typedef typename remove_cv<
+ typename remove_reference<
+ cr_data2_
+ >::type
+ >::type data2_;
+ typedef boost::fusion::pair<K2,data2_> pair_;
+ };
+ };
+
+ identity_f()
+ {}
+ identity_f(const F& f)
+ :f_(f){}
+ identity_f(const identity_f& that)
+ :f_(that.f_){}
+
+ identity_f& operator=(const identity_f& that)
+ {
+ if(&that!=this)
+ {
+ //static_cast<F&>(*this) = static_cast<const F&>(that);
+ this->f_ = that.f_;
+ }
+ return *this;
+ }
+
+ template<typename S>
+ struct result{};
+
+ template<typename F1,typename X>
+ struct result<F1(const X&)>
+ {
+ typedef typename identity::template apply<X> app1_;
+ typedef typename function::template apply<X> app2_;
+ typedef typename app1_::pair_ p1_;
+ typedef typename app2_::pair_ p2_;
+ typedef boost::fusion::map<p1_,p2_> type;
+ };
+
+ template<typename S>
+ struct sig : result<S>{};
+
+ template<typename X>
+ typename result<identity_f(const X&)>::type
+ operator()(const X& x)const
+ {
+ typedef typename result<identity_f(const X&)>::type type;
+ return type(
+ boost::fusion::make_pair<K1>(x),
+ boost::fusion::make_pair<K2>(
+ this->f_(x)
+ )
+ );
+ }
+
+ private:
+ F f_;
+ };
+
+}// map
+}// fusion
+}// detail
+}// statistics
+}// boost
+
+#endif

Modified: sandbox/statistics/detail/fusion/libs/statistics/detail/fusion/example/at_key.cpp
==============================================================================
--- sandbox/statistics/detail/fusion/libs/statistics/detail/fusion/example/at_key.cpp (original)
+++ sandbox/statistics/detail/fusion/libs/statistics/detail/fusion/example/at_key.cpp 2009-10-16 00:49:03 EDT (Fri, 16 Oct 2009)
@@ -20,7 +20,7 @@
 
 #include <boost/iterator/iterator_traits.hpp>
 
-#include <libs/statistics/detail/fusion/example/iterator_at_key.h>
+#include <libs/statistics/detail/fusion/example/at_key.h>
 
 void example_at_key_iterator(std::ostream& os){
 


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