|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64132 - in sandbox/variadic_templates: boost/composite_storage/pack/multiple_dispatch boost/fusion boost/fusion/algorithm boost/iostreams/filter boost/iostreams/utility libs/fusion libs/fusion/sandbox
From: cppljevans_at_[hidden]
Date: 2010-07-18 11:58:39
Author: cppljevans
Date: 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
New Revision: 64132
URL: http://svn.boost.org/trac/boost/changeset/64132
Log:
fusion if_recur initial commit
Added:
sandbox/variadic_templates/boost/fusion/
sandbox/variadic_templates/boost/fusion/algorithm/
sandbox/variadic_templates/boost/fusion/algorithm/if_recur.hpp (contents, props changed)
sandbox/variadic_templates/libs/fusion/
sandbox/variadic_templates/libs/fusion/sandbox/
sandbox/variadic_templates/libs/fusion/sandbox/if_recur.cpp (contents, props changed)
Text files modified:
sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/apply_unpack.hpp | 8 ++++++
sandbox/variadic_templates/boost/iostreams/filter/indent.hpp | 2
sandbox/variadic_templates/boost/iostreams/utility/indent_scoped_ostreambuf.hpp | 43 +++++++++++++--------------------------
3 files changed, 23 insertions(+), 30 deletions(-)
Modified: sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/apply_unpack.hpp
==============================================================================
--- sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/apply_unpack.hpp (original)
+++ sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/apply_unpack.hpp 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
@@ -53,11 +53,17 @@
typedef ResultType result_type;
template<typename... Args>
- result_type operator()(Args&... args)FUNCTOR_CONSTANCY throw()
+ result_type operator()(Args&... args) throw()
{
throw bad_functor_args<Functor(Args&...)>();
return result_type();
}
+ template<typename... Args>
+ result_type operator()(Args&... args)const throw()
+ {
+ throw bad_functor_args<Functor const(Args&...)>();
+ return result_type();
+ }
};
#else
Added: sandbox/variadic_templates/boost/fusion/algorithm/if_recur.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/boost/fusion/algorithm/if_recur.hpp 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
@@ -0,0 +1,421 @@
+//
+//ModificationHistor:
+// 2010/07/09
+// cp'ed from
+// http://svn.boost.org/svn/boost/sandbox/variadic_templates/boost/mpl/if_recur.hpp
+// 2010/07/10-?
+// adapted to fusion's needs, i.e. operates on values instead of types.
+//
+#ifndef BOOST_FUSION_IF_RECUR_HPP_20100709_1405UTC
+#define BOOST_FUSION_IF_RECUR_HPP_20100709_1405UTC
+// Copyright Larry Evans 2010
+//
+
+// $Id$
+// $Date: 2010/07/18 09:35:28 $
+// $Revision: 1.30 $
+
+#include <boost/utility/result_of.hpp>
+#include <boost/mpl/eval_if.hpp>
+
+namespace boost
+{
+namespace fusion
+{
+namespace aux
+{
+namespace if_recur
+{
+ enum
+ recur_kind
+ { recur_type //Recur arg to if_recur tests types.
+ , recur_value //Recur arg to if_recur tests values.
+ };
+
+ template
+ < class State
+ , bool Result=false
+ , recur_kind RecurKind=recur_value
+ >
+ struct always
+ {
+ static
+ recur_kind const
+ our_recur=RecurKind
+ ;
+ typedef
+ bool
+ result_type
+ ;
+ static
+ result_type
+ call
+ ( State const& state
+ )
+ {
+ return Result;
+ }
+ };
+ template
+ < class State
+ >
+ struct identity
+ {
+ typedef
+ State
+ result_type
+ ;
+ static
+ State
+ call
+ ( State const& state
+ )
+ {
+ return state;
+ }
+ };
+ template
+ < unsigned Index
+ , typename... Args
+ >
+ struct at_c
+ ;
+ template
+ < unsigned Index
+ , typename Head
+ , typename... Tail
+ >
+ struct at_c
+ < Index
+ , Head
+ , Tail...
+ >
+ {
+ typedef
+ at_c
+ < Index-1
+ , Tail...
+ >
+ tail_at_c
+ ;
+ typedef
+ typename tail_at_c::result_type
+ result_type
+ ;
+ static
+ result_type
+ call
+ ( Head const& head
+ , Tail const&... tail
+ )
+ {
+ return tail_at_c::call(tail...);
+ }
+ };
+ template
+ < typename Head
+ , typename... Tail
+ >
+ struct at_c
+ < 0
+ , Head
+ , Tail...
+ >
+ {
+ typedef
+ Head
+ result_type
+ ;
+ static
+ Head
+ call
+ ( Head const& head
+ , Tail const&...
+ )
+ {
+ return head;
+ }
+
+ };
+
+ namespace detail//just to emphasize it's not for user
+ {
+ template
+ < class StateNow
+ , class Recur
+ , class ThenDown
+ , class NowNow
+ , class NowUp
+ , class ElseBtm
+ , recur_kind RecurKind
+ >
+ struct impl //implements the if_result template
+ ;
+ template
+ < class StateNow
+ , class Recur
+ , class ThenDown
+ , class NowNow
+ , class NowUp
+ , class ElseBtm
+ >
+ struct impl
+ < StateNow
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , recur_value
+ >
+ {
+ typedef
+ typename boost::result_of
+ < ElseBtm(StateNow)
+ >::type
+ result_type
+ ;
+
+ static
+ result_type
+ call
+ ( StateNow const& state_now
+ )
+ {
+ #ifdef IF_RECUR_TRACE
+ indent_undent_cout iuc;
+ #endif
+ if(Recur::call(state_now))
+ {
+ return NowUp::call
+ ( NowNow::call(state_now)
+ , call
+ ( ThenDown::call(state_now)
+ )
+ );
+ }
+ else
+ {
+ return ElseBtm::call(state_now);
+ }
+ }
+ };
+
+ template
+ < class StateNow
+ , class Recur
+ , class ThenDown
+ , class NowNow
+ , class NowUp
+ , class ElseBtm
+ >
+ struct impl
+ < StateNow
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , recur_type
+ >
+ {
+
+ //#define SHOW_NOW_UP_LAZY_NEED
+ #ifndef SHOW_NOW_UP_LAZY_NEED
+ template
+ < typename StateLazy
+ >
+ struct result_of
+ ;
+
+ template
+ < typename StateLazy
+ >
+ struct now_up_lazy
+ {
+ typedef
+ typename NowUp::template result_of
+ < typename NowNow::template result_of
+ < typename StateLazy::type
+ >::type
+ , typename impl::template result_of
+ < typename ThenDown::template result_of
+ < typename StateLazy::type
+ >
+ >::type
+ >::type
+ type
+ ;
+ };
+ #endif
+ template
+ < typename StateLazy
+ >
+ struct result_of
+ : mpl::eval_if
+ < typename Recur::template result_of
+ < typename StateLazy::type
+ >
+ #ifndef SHOW_NOW_UP_LAZY_NEED
+ , now_up_lazy<StateLazy>
+ #else
+ , typename NowUp::template result_of
+ < typename NowNow::template result_of
+ < typename StateLazy::type
+ >::type
+ , typename impl::template result_of
+ < typename ThenDown::template result_of
+ < typename StateLazy::type
+ >
+ >::type
+ >
+ #endif
+ , typename ElseBtm::template result_of
+ < typename StateLazy::type
+ >
+ >
+ {};
+
+ typedef
+ #if 1
+ typename
+ result_of
+ < mpl::identity<StateNow>
+ >::type
+ #else
+ StateNow
+ #endif
+ result_type
+ ;
+ static
+ result_type
+ call
+ ( StateNow const& state_now
+ )
+ ;
+ private:
+ static
+ result_type
+ call_recur
+ ( StateNow const& state_now
+ , mpl::true_
+ )
+ {
+ typedef typename ThenDown::template result_of<StateNow>::type state_next;
+ return NowUp::call
+ ( NowNow::call(state_now)
+ , impl
+ < state_next
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , recur_type
+ >
+ ::call
+ ( ThenDown::call(state_now)
+ )
+ );
+ }
+ static
+ result_type
+ call_recur
+ ( StateNow const& state_now
+ , mpl::false_
+ )
+ {
+ return ElseBtm::call(state_now);
+ }
+ };
+
+ template
+ < class StateNow
+ , class Recur
+ , class ThenDown
+ , class NowNow
+ , class NowUp
+ , class ElseBtm
+ >
+ typename impl
+ < StateNow
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , recur_type
+ >::
+ result_type
+ impl
+ < StateNow
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , recur_type
+ >::
+ call
+ ( StateNow const& state_now
+ )
+ {
+ #ifdef IF_RECUR_TRACE
+ indent_undent_cout iuc;
+ #endif
+ typename Recur::template result_of<StateNow>::type recur;
+ return call_recur
+ ( state_now
+ , recur
+ );
+ }
+
+ }//exit detail namespace
+
+}//exit if_recur namespace
+}//exit aux namespace
+
+ //Notation:
+ //
+ // X -> Y = function from "type" X to "type" Y.
+ //
+ // State = some Kind of "state"
+ //Purpose:
+ // Almost the same as section 12.5 equation 1) of:
+ // http://www.thocp.net/biographies/papers/backus_turingaward_lecture.pdf
+ // The correspondences between this and that equaton is:
+ //
+ // this equation 1)
+ // ---- -----------
+ // if_recur f
+ // !Recur p
+ // ThenDown j
+ // NowNow i
+ // NowUp h
+ // ElseBtm g
+ //
+
+ template
+ < class StateNow//current state
+ , class Recur=aux::if_recur::always<StateNow>//::call: StateNow -> bool.
+ , class ThenDown=aux::if_recur::identity<StateNow>//::call: StateNow -> StateNow.
+ , class NowNow=aux::if_recur::identity<StateNow>//::call: StateNow -> StateNow.
+ , class NowUp=aux::if_recur::at_c<1,StateNow,StateNow>//::call: (StateNow,StateNow) -> StateNow.
+ , class ElseBtm=aux::if_recur::identity<StateNow>//::call: StateNow -> StateNow.
+ >
+ struct if_recur
+ : aux::if_recur::detail::impl
+ < StateNow
+ , Recur
+ , ThenDown
+ , NowNow
+ , NowUp
+ , ElseBtm
+ , Recur::our_recur
+ >
+ {
+ };
+
+}//exit fusion namespace
+}//exit boost namespace
+#endif
Modified: sandbox/variadic_templates/boost/iostreams/filter/indent.hpp
==============================================================================
--- sandbox/variadic_templates/boost/iostreams/filter/indent.hpp (original)
+++ sandbox/variadic_templates/boost/iostreams/filter/indent.hpp 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
@@ -29,7 +29,7 @@
typedef filter< output, Ch> super_type;
typedef Ch char_type;
- static int const width_default=4;
+ static int const width_default=2;
template<typename Sink>
bool put(Sink& dest, char_type c)
Modified: sandbox/variadic_templates/boost/iostreams/utility/indent_scoped_ostreambuf.hpp
==============================================================================
--- sandbox/variadic_templates/boost/iostreams/utility/indent_scoped_ostreambuf.hpp (original)
+++ sandbox/variadic_templates/boost/iostreams/utility/indent_scoped_ostreambuf.hpp 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
@@ -10,38 +10,25 @@
namespace boost { namespace iostreams {
-template<typename Ch>
-struct select_scoped_ostreambuf
-;
-template<>
-struct select_scoped_ostreambuf<char>
-{
- typedef filtering_ostreambuf type;
-};
-template<>
-struct select_scoped_ostreambuf<wchar_t>
-{
- typedef filtering_wostreambuf type;
-};
-
//
// Template name: indent_scoped_ostreambuf.
// Description: Temporarily replaces the ostreambuf of ostream
// passed to CTOR. DTOR restores original ostreambuf.
// Template paramters:
// Ch - The charactertype.
+// Tr - The character traits type.
//
-template<typename Ch=char>
+template<typename Ch=char, typename Tr=std::char_traits<Ch> >
class indent_scoped_ostreambuf
{
public:
- typedef std::basic_streambuf<Ch> std_buf_type;
- typedef std::basic_ostream<Ch> std_ostrm_type;
- typedef typename select_scoped_ostreambuf<Ch>::type filt_buf_type;
+ typedef std::basic_streambuf<Ch,Tr> std_buf_type;
+ typedef std::basic_ostream<Ch,Tr> std_ostrm_type;
+ typedef filtering_streambuf<output,Ch,Tr> filt_buf_type;
indent_scoped_ostreambuf
( std_ostrm_type& a_ostrm
- , int width=2
+ , int width=indent_filter<Ch>::width_default
)
: my_old_buf(a_ostrm.rdbuf())
, my_strm(a_ostrm)
@@ -66,7 +53,7 @@
push_filt_strmbuf
( std_buf_type& a_buf
- , int width=2
+ , int width=indent_filter<Ch>::width_default
)
{
filt_type my_filter(width);
@@ -95,11 +82,11 @@
// Function name: indent_buf
// Descrption:: Indents the buffer of ostream argument, if possible.
//
-template<class charT, class traits>
-inline std::basic_ostream<charT, traits>&
-indent_buf_in(std::basic_ostream<charT, traits>& os)
+template<class Ch, class Tr>
+inline std::basic_ostream<Ch, Tr>&
+indent_buf_in(std::basic_ostream<Ch, Tr>& os)
{
- typedef boost::iostreams::indent_scoped_ostreambuf<charT> filt_scoped_type;
+ typedef boost::iostreams::indent_scoped_ostreambuf<Ch,Tr> filt_scoped_type;
typedef typename filt_scoped_type::push_filt_strmbuf filt_strmbuf_type;
filt_strmbuf_type*buf_ptr = dynamic_cast<filt_strmbuf_type*>(os.rdbuf());
if (buf_ptr) {
@@ -113,11 +100,11 @@
// Function name: undent_buf
// Descrption:: Indents outwardly the buffer of ostream argument, if possible.
//
-template<class charT, class traits>
-inline std::basic_ostream<charT, traits>&
-indent_buf_out(std::basic_ostream<charT, traits>& os)
+template<class Ch, class Tr>
+inline std::basic_ostream<Ch, Tr>&
+indent_buf_out(std::basic_ostream<Ch, Tr>& os)
{
- typedef boost::iostreams::indent_scoped_ostreambuf<charT> filt_scoped_type;
+ typedef boost::iostreams::indent_scoped_ostreambuf<Ch,Tr> filt_scoped_type;
typedef typename filt_scoped_type::push_filt_strmbuf filt_strmbuf_type;
filt_strmbuf_type*buf_ptr = dynamic_cast<filt_strmbuf_type*>(os.rdbuf());
if (buf_ptr) {
Added: sandbox/variadic_templates/libs/fusion/sandbox/if_recur.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/libs/fusion/sandbox/if_recur.cpp 2010-07-18 11:58:38 EDT (Sun, 18 Jul 2010)
@@ -0,0 +1,434 @@
+//Purpose:
+// demonstrate if_recur.
+//
+#include <iostream>
+#include <boost/iostreams/utility/indent_scoped_ostreambuf.hpp>
+
+#define IF_RECUR_TRACE
+
+ struct indent_undent_cout
+ {
+ indent_undent_cout(void)
+ {
+ std::cout<<indent_buf_in;
+ }
+ ~indent_undent_cout(void)
+ {
+ std::cout<<indent_buf_out;
+ }
+ };
+
+#include <boost/fusion/algorithm/if_recur.hpp>
+#include <boost/fusion/container/list.hpp>
+#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/include/begin.hpp>
+#include <boost/fusion/include/end.hpp>
+#include <boost/fusion/include/next.hpp>
+#include <boost/fusion/include/deref.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+// For doing I/O
+#include <boost/fusion/sequence/io.hpp>
+
+namespace boost
+{
+namespace fusion
+{
+namespace example
+{
+
+ void show_default(void)
+ {
+ typedef if_recur<int> ir_t;
+ std::cout<<"show_default="<<ir_t::call( 9)<<"\n";
+ }
+
+
+ template
+ < int Max
+ >
+ struct less
+ {
+ static aux::if_recur::recur_kind const our_recur=aux::if_recur::recur_value;
+ typedef bool result_type;
+ static result_type call(int const& state)
+ {
+ return state<Max;
+ }
+ };
+
+ struct increment
+ {
+ typedef int result_type;
+ static result_type call(int const& state)
+ {
+ std::cout<<"increment:state="<<state<<"\n";
+ return state+1;
+ }
+ };
+
+ struct print_pair
+ {
+ typedef int result_type;
+ static result_type call(int const& state_now, int const& state_up)
+ {
+ std::cout
+ <<"print_pair"
+ <<":state_now="<<state_now
+ <<":state_up="<<state_up
+ <<"\n";
+ return state_up;
+ }
+ };
+
+ struct print_btm
+ {
+ typedef int result_type;
+ static result_type call(int const& state_btm)
+ {
+ std::cout
+ <<"print_btm"
+ <<":state_btm="<<state_btm
+ <<"\n";
+ return state_btm;
+ }
+ };
+
+ void show_less_increment(void)
+ {
+ typedef less<4> recur_t;
+ typedef increment then_down_t;
+ typedef aux::if_recur::identity<int> now_now_t;
+ typedef print_pair now_up_t;
+ typedef print_btm else_btm_t;
+ typedef
+ if_recur
+ < int
+ , recur_t
+ , then_down_t
+ , now_now_t
+ , now_up_t
+ , else_btm_t
+ >
+ ir_t;
+ std::cout<<"show_less_increment="<<ir_t::call( 0)<<"\n";
+ }
+
+ namespace show_recur_type
+ {
+ template
+ < int TypeId
+ >
+ struct int_val
+ {
+ int val_;
+ int_val(void):val_(TypeId){}
+ void reverse(void)
+ {
+ val_ = -val_;
+ }
+ friend
+ std::ostream&
+ operator<<
+ ( std::ostream& sout
+ , int_val<TypeId> const& self
+ )
+ {
+ sout<<"int_val<"<<TypeId<<">("<<self.val_<<")";
+ return sout;
+ }
+ };
+
+ template
+ < typename IterEnd
+ >
+ struct iter_print
+ {
+ template
+ < typename IterNow
+ >
+ void
+ operator()(IterNow const& a_now)const
+ {
+ typedef typename result_of::equal_to<IterNow,IterEnd>::type at_end_t;
+ at_end_t at_end_v;
+ this->call(a_now, at_end_v);
+ }
+
+ private:
+ template
+ < typename IterNow
+ >
+ void
+ call
+ ( IterNow const& a_now
+ , mpl::true_
+ )const
+ {
+ std::cout<<"\n";
+ }
+ template
+ < typename IterNow
+ >
+ void
+ call
+ ( IterNow const& a_now
+ , mpl::false_
+ )const
+ {
+ std::cout<<deref(a_now)<<" ";
+ this->operator()(next(a_now));
+ }
+
+ IterEnd const my_end;
+ };
+
+ template
+ < typename IterEnd
+ >
+ struct iter_not_end
+ {
+ struct recur
+ {
+ static aux::if_recur::recur_kind const our_recur=aux::if_recur::recur_type;
+
+ template
+ < typename IterNow
+ >
+ struct result_of
+ : mpl::not_<fusion::result_of::equal_to<IterNow,IterEnd> >
+ {};
+ };
+ };
+
+ template
+ < typename IterEnd
+ >
+ struct iter_next
+ {
+ template
+ < typename IterNow
+ >
+ struct result_of
+ : fusion::result_of::next<IterNow>
+ {};
+
+ template
+ < typename IterNow
+ >
+ static
+ typename result_of<IterNow>::type
+ call(IterNow const& iter_now)
+ {
+ std::cout<<"iter_next:\n";
+ iter_print<IterEnd> printer;
+ std::cout<<"iter_now=";
+ printer(iter_now);
+ return fusion::next(iter_now);
+ };
+ };
+
+ struct iter_identity
+ {
+ template
+ < typename IterNow
+ >
+ struct result_of
+ {
+ typedef IterNow type;
+ };
+
+ template
+ < typename IterNow
+ >
+ static
+ typename result_of<IterNow>::type
+ call(IterNow const& iter_now)
+ {
+ return iter_now;
+ };
+ };
+
+ template
+ < typename IterEnd
+ >
+ struct iter_btm
+ {
+ template
+ < typename IterNow
+ >
+ struct result_of
+ {
+ typedef IterNow type;
+ };
+
+ template
+ < typename IterNow
+ >
+ static
+ typename result_of<IterNow>::type
+ call(IterNow const& iter_now)
+ {
+ std::cout<<"iter_btm:\n";
+ iter_print<IterEnd> printer;
+ std::cout<<"iter_now=";
+ printer(iter_now);
+ return iter_now;
+ };
+ };
+
+ template
+ < typename IterEnd
+ , typename Target
+ >
+ struct iter_find_target
+ {
+ struct now_up
+ {
+ template
+ < typename IterNow
+ , typename IterUp
+ >
+ struct result_of
+ : mpl::eval_if
+ < fusion::result_of::equal_to
+ < IterUp
+ , IterEnd
+ >
+ , typename mpl::eval_if
+ < is_same
+ < Target&
+ , typename fusion::result_of::deref<IterNow>::type
+ >
+ , mpl::identity<IterNow>
+ , mpl::identity<IterUp>
+ >
+ , mpl::identity<IterUp>
+ >
+ {
+ };
+
+ template
+ < typename IterNow
+ , typename IterUp
+ >
+ static
+ IterNow
+ call_result
+ ( IterNow const& iter_now
+ , IterUp const& iter_up
+ , IterNow*
+ )
+ {
+ return iter_now;
+ }
+ template
+ < typename IterNow
+ , typename IterUp
+ >
+ static
+ IterUp
+ call_result
+ ( IterNow const& iter_now
+ , IterUp const& iter_up
+ , IterUp*
+ )
+ {
+ return iter_up;
+ }
+
+ template
+ < typename IterNow
+ , typename IterUp
+ >
+ static
+ typename result_of<IterNow,IterUp>::type
+ call
+ ( IterNow const& iter_now
+ , IterUp const& iter_up
+ )
+ {
+ std::cout<<"now_up:\n";
+ iter_print<IterEnd> printer;
+ std::cout<<"iter_now=";
+ printer(iter_now);
+ std::cout<<"iter_up=";
+ printer(iter_up);
+ typedef typename result_of<IterNow,IterUp>::type result_type;
+ return call_result
+ ( iter_now
+ , iter_up
+ , static_cast<result_type*>(0)
+ );
+ }
+
+ };//end now_up
+
+ };
+
+ void show(void)
+ {
+ typedef
+ int_val<-9>
+ target_val
+ ;
+ typedef
+ list
+ < target_val
+ , int_val<0>
+ , target_val
+ , int_val<2>
+ >
+ list_t
+ ;
+ // Let's specify our own tuple delimeters for nicer printing
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+ list_t list_v;
+ std::cout<<"list_v="<<list_v<<"\n";
+ std::cout<<"target_v="<<target_val()<<"\n";
+ typedef result_of::end<list_t>::type end_t;
+
+ typedef result_of::begin<list_t>::type state_t;
+ typedef iter_not_end<end_t>::recur recur_t;
+ typedef iter_next<end_t> then_down_t;
+ typedef iter_identity now_now_t;
+ typedef iter_find_target<end_t,target_val>::now_up now_up_t;
+ typedef iter_btm<end_t> else_btm_t;
+
+ typedef
+ if_recur
+ < state_t
+ , recur_t
+ , then_down_t
+ , now_now_t
+ , now_up_t
+ , else_btm_t
+ >
+ ir_t;
+ {
+ state_t state_v(begin(list_v));
+ auto result_v=ir_t::call(state_v);
+ end_t end_v(end(list_v));
+ iter_print<end_t> printer;
+ std::cout<<"result_v=";
+ printer(result_v);
+ }
+ }
+
+ }//exit show_recur_type
+
+}//exit example namespace
+}//exit fusion namespace
+}//exit boost namespace
+
+int main(void)
+{
+ boost::iostreams::indent_scoped_ostreambuf<char> iob(std::cout);
+ //boost::fusion::example::show_default();
+ //boost::fusion::example::show_less_increment();
+ boost::fusion::example::show_recur_type::show();
+ return 0;
+}
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