[parameter] How to create make_ functions with boost::parameter returning templated classes?
I want to write a make_ function for a complicated template, but can't figure out how to determine the deduced types for the return type: Say my class is: template<class F> struct templated_class { F f_; double y_; templated_class(F f, double y) : f_(i), y_(y){} }; I tried variations on the following for the template argument of templated_class: BOOST_PARAMETER_NAME(y) BOOST_PARAMETER_NAME(f) BOOST_PARAMETER_FUNCTION( (templated_class<typename boost::parameter::binding<ArgumentPack, tag::f>::type>), make_templated_class, tag, (required (f, *) ) (optional (i, *, 2.0) ) ) { return templated_class<typename boost::parameter::binding<ArgumentPack, tag::f>::type>(f, y); } This doesn't work. The parameter::binding was my attempt to extract the type, but ArgumentPack doesn't exist. Is this the right general method? What template parameter can I use for the metafunction? Thanks, Jesse
participants (1)
-
jesseperla