Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

nothrow_t Structure


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at nothrow_t Structure.

The struct is used as a function parameter to operator new to indicate that the function should return a null pointer to report an allocation failure, rather than throw an exception.

struct std::nothrow_t {};

The struct helps the compiler to select the correct version of the constructor. nothrow is a synonym for objects of type std::nothrow_t.

See operator new and operator new[] for examples of how std::nothrow_t is used as a function parameter.

Header: <new>

Namespace: std

Thread Safety in the C++ Standard Library

© 2017 Microsoft