Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::no_delete< T > Struct Template Reference

#include <gromacs/utility/nodelete.h>

Description

template<class T>
struct gmx::no_delete< T >

Deleter for std::shared_ptr that does nothing.

This is useful for cases where a class needs to keep a reference to another class, and optionally also manage the lifetime of that other class. The simplest construct (that does not force all callers to use heap allocation and std::shared_ptr for the referenced class) is to use a single std::shared_ptr to hold that reference, and use no_delete as the deleter if the lifetime is managed externally.

Public Member Functions

void operator() (T *)
 Deleter that does nothing.
 

The documentation for this struct was generated from the following file: