
hi all, i am currently having a hard time to figure out, how to use boost.parameter with default template arguments. i have a signature: typedef parameter::parameters<optional<tag::a>, optional<tag::b> > foo_signature; template <class X, class A = boost::parameter::void_, class B = boost::parameter::void_> class foo {}; now, how do i set a default parameter for one of the template arguments? it is either not documented, or i am missing the point, where it is explained ... thanks, tim -- tim@klingt.org http://tim.klingt.org Which is more musical, a truck passing by a factory or a truck passing by a music school? John Cage

On 7/11/2010 9:57 AM, Tim Blechmann wrote:
hi all,
i am currently having a hard time to figure out, how to use boost.parameter with default template arguments.
i have a signature:
typedef parameter::parameters<optional<tag::a>, optional<tag::b> > foo_signature;
template<class X, class A = boost::parameter::void_, class B = boost::parameter::void_> class foo {};
now, how do i set a default parameter for one of the template arguments? it is either not documented, or i am missing the point, where it is explained ...
thanks, tim
Try using boost::parameter::binding ...? typedef typename boost::parameter::parameters< ...
::bind< A, B >::type bound_params_type; typedef typename boost::parameter::binding< bound_params_type, [tag], [default] >::type ... ;
I'm only copying this from code I wrote using the Boost.Parameter library some time ago, so not sure if this is the recommended way... - Jeff

On Jul 11, 2010, at 12:57 PM, Tim Blechmann wrote:
hi all,
i am currently having a hard time to figure out, how to use boost.parameter with default template arguments.
now, how do i set a default parameter for one of the template arguments? it is either not documented, or i am missing the point, where it is explained
See http://www.boost.org/doc/libs/1_43_0/libs/parameter/doc/html/index.html#bind... "Note that defaults are specified by supplying an optional third argument to binding< … >" -- David Abrahams BoostPro Computing http://boostpro.com

i am currently having a hard time to figure out, how to use boost.parameter with default template arguments.
now, how do i set a default parameter for one of the template arguments? it is either not documented, or i am missing the point, where it is explained
See
http://www.boost.org/doc/libs/1_43_0/libs/parameter/doc/html/index.html#bind... intro
"Note that defaults are specified by supplying an optional third argument to binding< … >"
ah thanks, that's, what i was looking for! -- tim@klingt.org http://tim.klingt.org Im übrigen ist es gescheiter, sich warm zuzudecken als sich zu betrinken. Werner Schwab
participants (3)
-
David Abrahams
-
Jeffrey Lee Hellrung, Jr.
-
Tim Blechmann