
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