|
Boost : |
Subject: Re: [boost] Formal Review Request: TypeErasure
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-06-27 12:21:24
AMDG
On 06/27/2012 08:48 AM, Larry Evans wrote:
> On 06/26/12 14:18, Steven Watanabe wrote:
>>
>> Anyway, I can compile the following just fine with
>> MSVC 10.
>>
>> int i = 0;
>> call(binding<incrementable<int> >(mpl::map0<>()),
>> incrementable<int>(), i);
>> // i = 1
>
> But, AFAICT, that call doesn't have a concept as the 1st arg.
> To make the above call like the ones in my attached file, this
> would have to be:
>
> call(incrementable<int>(), i);
>
> The attached has that, and when it's compiled, it produces errors
> similar to the one previously mentioned here:
>
> http://article.gmane.org/gmane.comp.lib.boost.devel/232109
>
> more specifically, the errors include:
>
> ../../../boost/type_erasure/detail/get_signature.hpp:23:5: error:
> incomplete type 'void' used in nested name specifier
> BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, &Concept::apply)
> ^
>
> However, now I realize that's probably because there's no any in
> the argument list, a flaw you mention in the a) problem below.
> So, I'm inferring from your call example, which includes
> the binding<...>(...) arg, that somehow an any arg provides
> something like a binding?
>
> It would help me if more documentation on the args to
> call were supplied.
I agree. Here's the requirements in unedited form:
- The binding argument determines the dispatching.
- The concept argument must be present in the binding.
- If a binding is not specified it will be deduced
from the arguments. At least one of the arguments
must be an any.
- Whether an argument is treated as an any is determined
by the signature of the concept. Arguments that are
placeholders are involved in the dispatching. An
argument that is an /any/ in the signature of the
concept gets no special handling.
> Initially, I had thought call just
> used the 1st arg(the concept) for it's type, and then just
> called that type's static apply with the remaining args
> after, maybe, substituting the placeholders with ...
> Hmm... now I'm not sure what I was thinking, but what's
> becoming clearer to me is I need some more clarification
> on how call works because I'm not having much success
> in using it so far :(
>
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk