Ticket #3114: parameter_interface.patch
File parameter_interface.patch, 2.8 KB (added by , 13 years ago) |
---|
-
boost/parameter/aux_/tagged_argument.hpp
99 99 typename result_of0<F>::type 100 100 get_with_lazy_default(lazy_default<KW,F> const& x, int) const 101 101 { 102 return x.compute_default( );102 return x.compute_default(0); 103 103 } 104 104 105 105 template <class F> … … 140 140 template <class KW, class F> 141 141 typename result_of0<F>::type operator[](lazy_default<KW,F> const& x) const 142 142 { 143 return x.compute_default( );143 return x.compute_default(0); 144 144 } 145 145 146 146 template <class ParameterRequirements> -
boost/parameter/aux_/arg_list.hpp
114 114 typename result_of0<F>::type 115 115 get(lazy_default<K,F> x) const 116 116 { 117 return x.compute_default( );117 return x.compute_default(0); 118 118 } 119 119 #endif 120 120 … … 135 135 operator[]( 136 136 BOOST_PARAMETER_lazy_default_fallback<K,F> x) const 137 137 { 138 return x.compute_default( );138 return x.compute_default(0); 139 139 } 140 140 141 141 // No argument corresponding to ParameterRequirements::key_type -
boost/parameter/aux_/default.hpp
52 52 }; 53 53 # define BOOST_PARAMETER_lazy_default_fallback lazy_default_base 54 54 # else 55 template <typename DefaultComputer, typename T, typename Enable = void> 56 struct use_template_call_helper {}; 57 58 template <typename DefaultComputer, typename T> 59 struct use_template_call_helper<DefaultComputer, T, 60 typename 61 DefaultComputer 62 ::boost_parameter_use_nested_template> { 63 typedef typename boost::result_of<DefaultComputer()>::type type; 64 }; 65 55 66 template <class KW, class DefaultComputer> 56 67 struct lazy_default 57 68 { 58 69 lazy_default(const DefaultComputer& x) 59 : compute_default (x)70 : compute_default_obj(x) 60 71 {} 61 DefaultComputer const& compute_default; 72 DefaultComputer const& compute_default_obj; 73 74 template <typename T> 75 typename boost::result_of<DefaultComputer()>::type 76 compute_default(T, ...) const { 77 return compute_default_obj(); 78 } 79 80 template <typename T> 81 typename use_template_call_helper<DefaultComputer, T>::type 82 compute_default(T) const { 83 return compute_default_obj(0); 84 } 62 85 }; 63 86 # define BOOST_PARAMETER_lazy_default_fallback lazy_default 64 87 # endif