Section: 22.7.4 [any.class] Status: New Submitter: Thomas Köppe Opened: 2020-03-04 Last modified: 2020-04-04 19:02:52 UTC
View all other issues in [any.class].
View all issues with New status.
Several of the function specifications in 22.7.4 [any.class] have Throws: elements, but those only mention "exceptions thrown by a constructor". It seems necessary for std::any to perform dynamic allocation in general, and so in general there should be a possibility of an exception raised by such dynamic allocation. (This may come from a user-provided T::operator new, as far as I can tell.)We should revise the specifications to add relevant sources of exceptions. The functions that should probably mention allocations are:
any(const any& other)
template<class T> any(T&& value)
both any(in_place_t<T>, …) overloads
any& operator=(const any& rhs)
template<class T> any& operator=(T&& rhs)
all emplace overloads
[2020-04-04 Issue Prioritization]
Priority to 3 after reflector discussion.