从C++ 11标准(15.1.p4):
除非在3.7.4.1中指出,否则异常对象的内存以未指定的方式分配
如果分配失败怎么办 - 它会抛出std::bad_alloc吗?打电话std::terminate?未指定?
从C++ 11个的起始<regex>报头定义的功能std::regex_match,std::regex_search并且std::regex_replace在§28.11.我想这些函数不存在是有正当理由的noexcept,但我找不到任何关于这些函数可能抛出的原因或原因.
regex_match(anyString, regex("."))从不抛出?PS:由于其中一些异常可能继承std::runtime_error,他们可能会std::bad_alloc在构建过程中抛出.