난 그냥 C++ (17)가 int
를 반환하는 std::uncaught_exceptions()
과 더불어, bool
를 반환하는 std::uncaught_exception()
을 대체 할 것이다std :: uncaught_exceptions로 std :: uncaught_exception이 변경되는 이유는 무엇입니까?
http://en.cppreference.com/w/cpp/error/uncaught_exception
에 걸쳐 나타났습니다.
http://isocpp.org/files/papers/n4259.pdf
그것은 근거를 제공하지 않고 있지만
[참고 말할 않는다 :
이 기술 표준에 첨가 여기 uncaught_exceptions()> 0, 예외를 던지면 std :: terminate() (15.5.1) 호출이 발생할 수 있습니다. - 끝말]
이상하게 모호합니다.
변경 이유는 무엇입니까? C++ 17 또는 향후 표준 버전에서 여러 활성 예외가 가능합니까?
여러 가지 활성 예외가 모든 버전의 C++에 존재할 수 있습니다. 'struct foo {~ foo() {try {throw new int; } catch (...) {}}}; int main() {{foo f; 새로운 더블 던져; } catch (...) {}}'는'f'를 파기 할 때 두 가지 활성 예외가 있습니다. – Yakk
참고 사항 [this CppCon 2015 talk] (https://github.com/CppCon/CppCon2015/blob/master/Presentations/Declarative%20Control%20Flow/Declarative%20Control%20Flow%20-%20Andrei%20Alexandrescu%20-% 20CppCon % 202015.pdf) Andrei Alexandrescu의 'ScopeGuard'와 N4259에 대한 정보. – Adversus