3 ms·
> but I'm pointing out the standard explicitly lets vector's constructors fail Yeah, but that thing has more than one constructor. Since C++/17, the default co
by Const-me 5y ago
> but I'm pointing out the standard explicitly lets vector's constructors fail
Yeah, but that thing has more than one constructor. Since C++/17, the default constructor of std::vector which doesn’t allocate any storage is usually marked as noexcept, i.e. the standard does not allow it to throw anything. This feature allows to make classes which contain vectors yet don’t throw exceptions from constructors.
P.S. The move constructor of std::vector is marked with noexcept as well, i.e. it’s even possible to construct non-empty vectors without any exceptions.
- dataflow 5y agoTry https://en.cppreference.com/w/cpp/container/set/set https://en.cppreference.com/w/cpp/container/set/set