Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 1.02 KB

File metadata and controls

20 lines (15 loc) · 1.02 KB
title C26409
ms.date 07/21/2017
ms.topic conceptual
f1_keywords
C26409
helpviewer_keywords
C26409
ms.assetid a3b3a229-d566-4be3-bd28-2876ccc8dc37

C26409 NO_NEW_DELETE

Even if code is clean of calls to malloc() and free() we still suggest that you consider better options than explicit use of operators new and delete.

C++ Core Guidelines: R.11: Avoid calling new and delete explicitly

The ultimate fix is to start using smart pointers with appropriate factory functions, such as std::make_unique.

Remarks

  • The checker warns on calls to any kind of operator new or delete: scalar, vector, overloaded versions (global and class-specific), as well as on placement versions. The latter case may require some clarifications on the Core Guidelines in terms of suggested fixes and may be omitted in the future.