X
X
xperious2016-01-22 23:07:42
C++ / C#
xperious, 2016-01-22 23:07:42

What is the fundamental difference between __declspec(nothrow) and noexcept?

tell me what is the main difference between

__declspec(nothrow) void hello_world()
{}

from
void hello_world noexcept
{}

?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2016-01-23
@jcmvbkbc

According to MSDN , __declspec(nothrow) is the Microsoft equivalent of the throw() specifier. The behavior of a function with the throw specifier is somewhat different from the behavior of a function with the noexcept specifier in case of an exception that will not be caught by such a function: throw() calls std::unexpected, and noexcept goes straight to std::terminate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question