
AMDG On 07/26/2012 09:21 AM, Larry Evans wrote:
However, in my defense, I couldn't see any reason why, if:
any<Concept,_a> a_any
can be created with static_map<Concept>, it couldn't be created with a binding<Concept>; thus, I guess I just glossed over the any.html#id2445089-bb doc.
The reason I didn't provide it, is that I assumed that if the type you're constructing is known statically, the entire set of type bindings would be known statically.
BTW what *is* the reason for the restriction on the Concept in the binding<Concept> CTOR. It's obviously not needed for creating an instance of AnyA with a value<_a>::type even when ConceptAB does not "contain a matching instance of constructible".
Yes it is. You're not understanding what this constructor does properly. 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. In Christ, Steven Watanabe