Boost logo

Boost :

Subject: Re: [boost] [type_erasure]any(const binding<Concept>&, ...) compile error
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-07-27 14:54:18


On 07/27/12 13:08, Steven Watanabe wrote:
> AMDG
>
> On 07/27/2012 09:49 AM, Larry Evans wrote:
>>
>> The attached, when compiled with:
>>
>> #define CONSTRUCTIBLE_PH
>>
>> fails compilation despite satisfying this Concept constraint
>> mentioned above.
>>
>
> It doesn't satisfy the requirements.
>
>> However, when:
>>
>> //#define CONSTRUCTIBLE_PH
>>
>> it compiles & runs OK. The compiling version just doesn't use a
>> placeholder in the args to Sig of constructible.
>>
>> Why doesn't the one with the placeholder in the Sig args compile?
>> Maybe I'm not understanding what's meant by:
>>
>> Concept must contain a matching instance of constructible.
>>
>> Could you please explain what I'm missing?
>>
>
> You're passing an argument of type ph_value<_a>.
> How would constructible<_a(const _a&)> (which
> is the copy constructor) be viable?
>

Because, when _a in constructible<_a(const _a&)> is replaced by the
binding, it becomes, IIUC,

  constructible<ph_value<_a>(const ph_value<_a>&)>

and this is the same as the compiling version of binding_of.cpp.
I thought this replacement is what would happen based on the example:

  constructible<_a(const _b&, const _c&)>

from:

http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/construction.html

Why is the replacement done in the construction.html example and not
in bindings_of.cpp? Hmmm... Ok, the example has any args, from which
the bindings<ConceptA> can be gotten. But those same bindings are
available from the binding<ConceptA> arg in bindings_of.cpp creation
of a_dup.

Obviously I'm still missing something, but I've no clue what :(

Any help would be appreciated.

-regards,
Larry


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