Gromacs
2026.0-dev-20241204-d69d709
|
Typedefs | |
using | DeleterType = int(*)(int) |
Functions | |
int | deleterSetter (int object) |
std::pair< int, sg::detail::scope_guard < BoundDeleter > > | makeGuard (int object, DeleterType deleter) |
Variables | |
static int | s_deleterValue = 0 |
Global value which is set by the below function. More... | |
|
static |
Global value which is set by the below function.
A global value is used here because we want to ensure that the scope guards execute a callback function of form int(*)(int) (similar to closing functions used by the HDF5 library, e.g. H5Gclose) when going out of scope.
We need to inspect the value after the guard exits and the simplest way is to use a global variable.