Boost logo

Boost :

Subject: Re: [boost] [parameter] type requirement compiler error
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-11-05 07:17:16


On Fri, Nov 4, 2011 at 10:53 PM, Cromwell Enage <sponage_at_[hidden]> wrote:
> From: Lorenzo Caminiti
>
>> The following example raises the same Boost.Parameter error
>> and it uses no graph library:
>
> // File: 01.cpp
> #include <boost/parameter.hpp>
> #include <iostream>
>
> BOOST_PARAMETER_NAME(x)
> BOOST_PARAMETER_NAME(y)
>
> BOOST_PARAMETER_FUNCTION(
>     (void),
>     f,
>     tag,
>     (required
>         (x, *)
>         (y, (tag::x::_))
>     )
> ) {
>     std::cout << x << " " << y << std::endl;
> }
>
> int main ( void )
> {
>     f(1, 2);
>     return 0;
> }
>
> Reply:
> IME you can't use (void) as a return type.  As a workaround I use (bool) and return a constant (true or false).

Thanks but that's not the issue:
1) If you remove the tag::x::_ (e.g., use int for y's type) then it
compiles with (void), (bool), and any other result type.
2) If you leave the tag::x::_ as y's type then it does not compile
with neither (void), (bool), or any other result type (for all result
types you get the same error as above). As far as I understand, the
last error about the result type might be induced by the first error
which is about mpl::_2 not being bound to a Boost.Parameter argument
pack-- who should do that binding? how?

Please someone help :)

NOTE: I can't implement Boost.Contract support for named parameter
without this feature because within the contract macros I need to
refer to the parameter types. This is a blocking issue for integrating
Boost.Parameter in Boost.Contract!!

--Lorenzo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk