Boost logo

Boost Users :

From: François Duranleau (duranlef_at_[hidden])
Date: 2007-10-01 01:16:03


Hi!

I have a function like this:

template< typename Arg0 ,
           typename Arg1 ,
           ... >
Arg1 the_function( Arg0 arg0 , Arg1 arg1 , ... ) { ... }

The return type should be the same as one of its parameters, and all '...'
are optional parameters. Is there a way to use BOOST_PARAMETER_FUNCTION in
such a case? I didn't find anything in the documentation about it. I tried
this:

BOOST_PARAMETER_NAME( (arg1 , kw) arg1 )
BOOST_PARAMETER_NAME( (arg2 , kw) arg2 )

BOOST_FUNCTION_PARAMETER(
     (kw::arg2::_) ,
     the_function ,
     kw ,
     (required (arg1 , *) (arg2 , *))
     (optional ...)
)

but it doesn't work. Looking at the macro's expansion, the meta function
used to extract the result type seems to ignore it's template argument
Args. Is it a limitation or a bug?

Are there any other tricks (aside from manually handling argument packs as
before)?

-- 
Francois Duranleau

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net