Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
SimpleGuard< R > Struct Template Reference

A default template parameter for GuardedCall<R> More...

#include <AudacityException.h>

Public Member Functions

 SimpleGuard (const R &value) noexcept(noexcept(R{ std::declval< const R & >() }))
 
operator() (AudacityException *) const noexcept(noexcept(R{ std::declval< R >() }))
 

Public Attributes

const R m_value
 

Detailed Description

template<typename R>
struct SimpleGuard< R >

A default template parameter for GuardedCall<R>

Template Parameters
Rreturn type from GuardedCall (or convertible to it)

Definition at line 131 of file AudacityException.h.

Constructor & Destructor Documentation

◆ SimpleGuard()

template<typename R >
SimpleGuard< R >::SimpleGuard ( const R &  value)
inlineexplicitnoexcept
Parameters
valueThe value to return from GuardedCall when an exception is handled

Definition at line 133 of file AudacityException.h.

136 { std::declval<const R&>() } ))
137 : m_value{ value } {}

Member Function Documentation

◆ operator()()

template<typename R >
R SimpleGuard< R >::operator() ( AudacityException ) const
inlinenoexcept

Definition at line 138 of file AudacityException.h.

139 { std::declval<R>() } ))
140 { return m_value; }

Member Data Documentation

◆ m_value

template<typename R >
const R SimpleGuard< R >::m_value

Definition at line 141 of file AudacityException.h.

Referenced by SimpleGuard< bool >::operator()().


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