From c606f2ef71e8a3e2ad7a55e39aa85264ec3e079b Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Sun, 1 Mar 2015 16:50:16 +0000 Subject: [PATCH] function/lazy_list.hpp Amend types for T in cons --- include/boost/phoenix/function/lazy_list.hpp | 40 +++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/include/boost/phoenix/function/lazy_list.hpp b/include/boost/phoenix/function/lazy_list.hpp index 0c04be8..6e4f50e 100644 --- a/include/boost/phoenix/function/lazy_list.hpp +++ b/include/boost/phoenix/function/lazy_list.hpp @@ -1157,37 +1157,41 @@ bool operator<( a_unique_type_for_nil, const list& b ) { template struct ConsHelp2 { + typedef typename boost::remove_reference::type TT; typedef typename L::force_result_type type; - static type go( const T& x, const F& f ) { + static type go( const TT& x, const F& f ) { return type( x, f ); } }; template struct ConsHelp2,true> { - typedef list L; + typedef typename boost::remove_reference::type TT; + typedef list L; typedef typename L::force_result_type type; - static type go( const T& x, const F& f ) { - return odd_list(x, list( - boost::intrusive_ptr >(new Cache( - typename Cache::CvtFxn(),f)))); + static type go( const TT& x, const F& f ) { + return odd_list(x, list( + boost::intrusive_ptr >(new Cache( + typename Cache::CvtFxn(),f)))); } }; template struct ConsHelp2,true> { - typedef odd_list L; + typedef typename boost::remove_reference::type TT; + typedef odd_list L; typedef typename L::force_result_type type; - static type go( const T& x, const F& f ) { - return odd_list(x, list( ListRaw(), new Cache(f) )); + static type go( const TT& x, const F& f ) { + return odd_list(x, list( ListRaw(), new Cache(f) )); } }; template struct ConsHelp2 { - typedef odd_list type; - static type go( const T& x, const F& f ) { - return odd_list(x, list( ListRaw(), new Cache(f) )); + typedef typename boost::remove_reference::type TT; + typedef odd_list type; + static type go( const TT& x, const F& f ) { + return odd_list(x, list( ListRaw(), new Cache(f) )); } }; @@ -1198,8 +1202,9 @@ bool operator<( a_unique_type_for_nil, const list& b ) { } }; template struct ConsHelp1 { - typedef odd_list type; - static type go( const T& x, const a_unique_type_for_nil& n ) { + typedef typename boost::remove_reference::type TT; + typedef odd_list type; + static type go( const TT& x, const a_unique_type_for_nil& n ) { return type(x,n); } }; @@ -1228,13 +1233,13 @@ bool operator<( a_unique_type_for_nil, const list& b ) { template struct ConsHelp0 { typedef typename boost::remove_reference::type TT; - typedef odd_list type; + typedef odd_list type; }; template struct ConsHelp0 { typedef typename boost::remove_reference::type TT; - typedef odd_list type; + typedef odd_list type; }; template @@ -1270,7 +1275,8 @@ bool operator<( a_unique_type_for_nil, const list& b ) { template struct result { - typedef odd_list type; + typedef typename boost::remove_reference::type TT; + typedef odd_list type; }; template