[Parameter] template return type

I am trying to use Boost.Parameter to construct some objects, much like make_tuple(A,B) does except with some of the arguments being optional and replaced by defaults (which may depend on the other arguments). The return type, however, must be a template class with the template arguments dependent on the arguments supplied. Is this possible? How can the return type for a Boost.Parameter frunction be specified as a template type? Thanks for your help. Cheers, Brook

Brook Milligan wrote:
I am trying to use Boost.Parameter to construct some objects, much like make_tuple(A,B) does except with some of the arguments being optional and replaced by defaults (which may depend on the other arguments). The return type, however, must be a template class with the template arguments dependent on the arguments supplied.
Is this possible?
Yes, this is possible. The argument pack is available to the return type computation as `Args`. Something like this should work: BOOST_PARAMETER_FUNCTION( (typename boost::parameter::value_type<Args, tag::x>::type), foo, ... ) This only work on trunk unfortunately and since it's not very well covered in the test suite there might be problems with it. HTH, -- Daniel Wallin Boost Consulting www.boost-consulting.com
participants (2)
-
brook@biology.nmsu.edu
-
Daniel Wallin