Boost logo

Boost :

Subject: Re: [boost] [type_erasure]any(const binding<Concept>&, ...) compile error
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-27 00:17:03


AMDG

On 07/26/2012 04:44 PM, Larry Evans wrote:
> On 07/26/12 15:32, Steven Watanabe wrote:
>>
>> template<class... T>
>> explicit any(binding<Concept>, T&& ...);
>>
>> calls a type erased constructor.
>> The stored type is whatever the binding
>> says, /not/ T. constructible<...> is
>> required, because it is used to construct
>> the contained object.
>>
>
> But this:
>
> constructible<...> is
> required, because it is used to construct
> the contained object.
>
> contradicts what happens with the static_binding CTOR because
> an AnyA *is* constructed with that CTOR when ConceptAB does *not*
> contain constructible<a_(...)>. Now it's obviously required by the
> binding<ConceptAB> CTOR, but that is, AFAICT, an unneeded restriction.
>
> Now if you made the 2 constructors consistent (i.e. both requiring
> constructible<a_(...)>, I could see your point; however, as long as
> the static_binding allows creation with constructible<a_(...)>, then
> the other one should also.
>

The two constructors in question have
different requirements because they serve
fundamentally different purposes.

There are three kinds of constructors:

- Constructors that capture an object and
  create a new set of type bindings.
- Constructors that are dispatched using
  an existing set of type bindings.
- Constructors that convert between anys.

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