Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <stl_util.h>
Public Member Functions | |
template<typename STLContainer > | |
ElementDeleter (STLContainer *ptr) | |
~ElementDeleter () | |
ElementDeleter (const ElementDeleter &)=delete | |
void | operator= (const ElementDeleter &)=delete |
ElementDeleter is an RAII object that deletes the elements in the given container when it goes out of scope. This is similar to std::unique_ptr<> except that a container's elements will be deleted rather than the container itself.
Example: std::vector<MyProto*> tmp_proto; ElementDeleter d(&tmp_proto); if (...) return false; ... return success;
Since C++11, consider using containers of std::unique_ptr instead.
Definition at line 434 of file stl_util.h.
|
inlineexplicit |
Definition at line 437 of file stl_util.h.
|
inline |
Definition at line 440 of file stl_util.h.
|
delete |
|
delete |