Created on 2015-03-27.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4296.
Change [except.nested] as depicted:
template <class T> [[noreturn]] void throw_with_nested(T&& t);-6- Let U be remove_reference_t<T>.
-7- Requires: U shall be CopyConstructible. -8- Throws: ifU is a non-union class type not derived from nested_exceptionis_class<U>::value && !is_final<U>::value && !is_base_of<nested_exception, U>::value is true, an exception of unspecified type that is publicly derived from both U and nested_exception and constructed from std::forward<T>(t), otherwise std::forward<T>(t).
[ 2015-05, Lenexa ]
STL, MC and JW already do this
MC: move to Ready, bring to motion on Friday
7 in favor, none opposed
When N2559 was voted into the Working Paper, it said "This function template must take special case to handle non-class types, unions and [[final]] classes that cannot be derived from, and [...]". However, its Standardese didn't handle final classes, and this was never revisited. Now that we have is_final, we can achieve this proposal's original intention.
Additionally, we need to handle the case where U is nested_exception itself. is_base_of's wording handles this and ignores cv-qualifiers. (Note that is_class detects "non-union class type".)History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2015-10-27 16:52:45 | admin | set | status: ready -> wp |
2015-05-07 23:01:40 | admin | set | messages: + msg7390 |
2015-05-07 23:01:40 | admin | set | status: new -> ready |
2015-04-02 21:28:12 | admin | set | messages: + msg7311 |
2015-03-27 00:00:00 | admin | create |