François Duranleau wrote:
On Mon, 1 Oct 2007, David Abrahams wrote:
[...]
See http://boost.org/libs/parameter/doc/html/index.html#adding-type-requirements
I tried this simple example:
//--------------------------------------------- #include
#include BOOST_PARAMETER_NAME( (arg1 , kw) arg1 )
BOOST_PARAMETER_FUNCTION( (arg1_type) , the_function , kw , (required (arg1 , *)) ) { return arg1; }
int main() { int i = the_function( 1 ) ; return 0 ; } //---------------------------------------------
but it won't compile either (gcc-4.0.2). Actually, if we look at the preprocessed output, it's not surprising. Here is the part of interest [...]
I looked for examples in Boost.Parameter's test programs, alas, it seems there are no tests written for this feature.
Right. This is a doc error. You need extract the type from the argument
pack Args:
BOOST_PARAMETER_FUNCTION(
(typename boost::parameter::value_type