Created on 2016-07-10.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4606.
Modify [any.cons] as indicated:
template<class ValueType> any(ValueType&& value);[…]
-7- Requires: T shall satisfy the CopyConstructible requirements. If is_copy_constructible_v<T> is false, the program is ill-formed. -8- Effects: Constructs an object of type any that contains an object of type T direct-initialized with std::forward<ValueType>(value). -9- Remarks: This constructor shall not participate in overload resolution if decay_t<ValueType> is the same type as any or if ValueType is a specialization of in_place_type_t. […]template <class T, class... Args> explicit any(in_place_type_t<T>, Args&&... args);-?- Remarks: This constructor shall not participate in overload resolution unless is_constructible_v<T, Args...> is true […]
-11- Requires: is_constructible_v<T, Args...> is true.template <class T, class U, class... Args> explicit any(in_place_type_t<T>, initializer_list<U> il, Args&&... args);[…] -19- Remarks:
-15- Requires: is_constructible_v<T, initializer_list<U>&, Args...> is true.The functionThis constructor shall not participate in overload resolution unless is_constructible_v<T, initializer_list<U>&, Args...> is true.
[ 2016-07 Chicago ]
Monday: P0 - tentatively ready
The in_place constructor that takes an initializer_list has both a Requires: for is_constructible and a Remarks: for is_constructible. The one that takes just a pack has just a Requires: for is_constructible.
I think both of those should be Remarks:, i.e. SFINAEable constraints. Otherwise querying is_constructible for an any with in_place_t will not give a reasonable answer, and I utterly fail to see any implementation burden in SFINAEing those constructors.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-01 18:34:48 | admin | set | messages: + msg8282 |
2016-08-01 18:34:48 | admin | set | status: new -> ready |
2016-07-24 18:47:31 | admin | set | messages: + msg8246 |
2016-07-10 00:00:00 | admin | create |