Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When using the nonthrowing form, it is imperative to check that the return value is not nullptr before accessing the resulting pointer. When using either form, be sure to comply with ERR30-CPP. Try to recover gracefully from unexpected errorsDo not call std::terminate(), std::abort(), or std::_Exit().

Noncompliant Code Example

...

[ISO/IEC 14882-2014]

18.6.1.1, "Single-object Forms"
18.6.1.2, "Array Forms"
20.7.9.1, "Allocator Members"

[ISO/IEC 9899:2011]Section 7.20.3, "Memory management functions"
[Meyers 95]Item 7. Be prepared for out-of-memory conditions.
[Seacord 2013b]Chapter 4, "Dynamic Memory Management"

 Image Removed Image Removed Image Removed

...

Image Added Image Added Image Added