Version: SMASH-3.1
smash::GslWorkspaceDeleter Struct Reference

#include <integrate.h>

A deleter type for std::unique_ptr to be used with gsl_integration_workspace pointers.

This will call gsl_integration_workspace_free instead of delete.

Definition at line 37 of file integrate.h.

Public Member Functions

constexpr GslWorkspaceDeleter ()=default
 The class has no members, so this is a noop. More...
 
void operator() (gsl_integration_cquad_workspace *ptr) const
 Frees the gsl_integration_cquad_workspace resource if it is non-zero. More...
 

Constructor & Destructor Documentation

◆ GslWorkspaceDeleter()

constexpr smash::GslWorkspaceDeleter::GslWorkspaceDeleter ( )
constexprdefault

The class has no members, so this is a noop.

Member Function Documentation

◆ operator()()

void smash::GslWorkspaceDeleter::operator() ( gsl_integration_cquad_workspace *  ptr) const
inline

Frees the gsl_integration_cquad_workspace resource if it is non-zero.

Definition at line 42 of file integrate.h.

42  {
43  if (ptr == nullptr) {
44  return;
45  }
46  gsl_integration_cquad_workspace_free(ptr);
47  }

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