Geant4-11
Public Member Functions | Private Attributes
PTL::ScopeDestructor Struct Reference

#include <Types.hh>

Public Member Functions

ScopeDestructoroperator= (const ScopeDestructor &)=delete
 
ScopeDestructoroperator= (ScopeDestructor &&rhs) noexcept
 
 ScopeDestructor (const ScopeDestructor &)=delete
 
template<typename FuncT >
 ScopeDestructor (FuncT &&_func)
 
 ScopeDestructor (ScopeDestructor &&rhs) noexcept
 
 ~ScopeDestructor ()
 

Private Attributes

std::function< void()> m_functor = []() {}
 

Detailed Description

Definition at line 124 of file Types.hh.

Constructor & Destructor Documentation

◆ ScopeDestructor() [1/3]

template<typename FuncT >
PTL::ScopeDestructor::ScopeDestructor ( FuncT &&  _func)
inline

Definition at line 127 of file Types.hh.

128 : m_functor(std::forward<FuncT>(_func))
129 {}
std::function< void()> m_functor
Definition: Types.hh:154

◆ ScopeDestructor() [2/3]

PTL::ScopeDestructor::ScopeDestructor ( const ScopeDestructor )
delete

◆ ScopeDestructor() [3/3]

PTL::ScopeDestructor::ScopeDestructor ( ScopeDestructor &&  rhs)
inlinenoexcept

Definition at line 136 of file Types.hh.

137 : m_functor(std::move(rhs.m_functor))
138 {
139 rhs.m_functor = []() {};
140 }

◆ ~ScopeDestructor()

PTL::ScopeDestructor::~ScopeDestructor ( )
inline

Definition at line 151 of file Types.hh.

151{ m_functor(); }

References m_functor.

Member Function Documentation

◆ operator=() [1/2]

ScopeDestructor & PTL::ScopeDestructor::operator= ( const ScopeDestructor )
delete

◆ operator=() [2/2]

ScopeDestructor & PTL::ScopeDestructor::operator= ( ScopeDestructor &&  rhs)
inlinenoexcept

Definition at line 141 of file Types.hh.

142 {
143 if(this != &rhs)
144 {
145 m_functor = std::move(rhs.m_functor);
146 rhs.m_functor = []() {};
147 }
148 return *this;
149 }

References m_functor.

Field Documentation

◆ m_functor

std::function<void()> PTL::ScopeDestructor::m_functor = []() {}
private

Definition at line 154 of file Types.hh.

Referenced by operator=(), and ~ScopeDestructor().


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