Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
doctest::detail::ExceptionTranslator< T > Class Template Reference

OCLINT destructor of virtual class. More...

#include <doctest.h>

+ Inheritance diagram for doctest::detail::ExceptionTranslator< T >:

Public Member Functions

 ExceptionTranslator (String(*translateFunction)(T))
 
bool translate (String &res) const override
 

Private Attributes

String(* m_translateFunction )(T)
 

Detailed Description

template<typename T>
class doctest::detail::ExceptionTranslator< T >

OCLINT destructor of virtual class.

Definition at line 1803 of file doctest.h.

Constructor & Destructor Documentation

◆ ExceptionTranslator()

template<typename T >
doctest::detail::ExceptionTranslator< T >::ExceptionTranslator ( String(*)(T) translateFunction)
inlineexplicit

Definition at line 1806 of file doctest.h.

1807 : m_translateFunction(translateFunction) {}

Member Function Documentation

◆ translate()

template<typename T >
bool doctest::detail::ExceptionTranslator< T >::translate ( String & res) const
inlineoverridevirtual

Implements doctest::detail::IExceptionTranslator.

Definition at line 1809 of file doctest.h.

1809 {
1810#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
1811 try {
1812 throw; // lgtm [cpp/rethrow-no-exception]
1813 // cppcheck-suppress catchExceptionByValue
1814 } catch(const T& ex) {
1815 res = m_translateFunction(ex); //!OCLINT parameter reassignment
1816 return true;
1817 } catch(...) {} //!OCLINT - empty catch statement
1818#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
1819 static_cast<void>(res); // to silence -Wunused-parameter
1820 return false;
1821 }

Field Documentation

◆ m_translateFunction

template<typename T >
String(* doctest::detail::ExceptionTranslator< T >::m_translateFunction) (T)
private

Definition at line 1824 of file doctest.h.


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