cli11
Loading...
Searching...
No Matches
cli::detail::error_mixin_t< derived_t, base_t > Class Template Referenceexport
module cli11

Supplies the constructor set every error type shares. More...

Inheritance diagram for cli::detail::error_mixin_t< derived_t, base_t >:

Public Member Functions

 error_mixin_t (std::string msg, exit_codes_t exit_code)
 Constructs the error, naming it from derived_t.
 error_mixin_t (std::string msg, int exit_code)
 Constructs the error, naming it from derived_t.

Protected Member Functions

 error_mixin_t (std::string ename, std::string msg, int exit_code)
 Forwards an explicit type name, for further derivation.
 error_mixin_t (std::string ename, std::string msg, exit_codes_t exit_code)
 Forwards an explicit type name, for further derivation.

Detailed Description

template<typename derived_t, typename base_t>
class cli::detail::error_mixin_t< derived_t, base_t >

Supplies the constructor set every error type shares.

Each error type in the hierarchy needs the same four constructors: a protected pair taking an explicit type name, so that further derivation works, and a public pair that fills the name in automatically. This mixin generates all four, reading the name from derived_t::error_type_name.

Template Parameters
derived_tThe error type being defined; must declare a static constexpr std::string_view error_type_name.
base_tThe error type to derive from.

Constructor & Destructor Documentation

◆ error_mixin_t() [1/4]

template<typename derived_t, typename base_t>
cli::detail::error_mixin_t< derived_t, base_t >::error_mixin_t ( std::string ename,
std::string msg,
int exit_code )
inlineprotected

Forwards an explicit type name, for further derivation.

Parameters
enameShort name of the concrete error type.
msgHuman-readable description.
exit_codeProcess exit code to report.

◆ error_mixin_t() [2/4]

template<typename derived_t, typename base_t>
cli::detail::error_mixin_t< derived_t, base_t >::error_mixin_t ( std::string ename,
std::string msg,
exit_codes_t exit_code )
inlineprotected

Forwards an explicit type name, for further derivation.

Parameters
enameShort name of the concrete error type.
msgHuman-readable description.
exit_codeProcess exit code to report.

◆ error_mixin_t() [3/4]

template<typename derived_t, typename base_t>
cli::detail::error_mixin_t< derived_t, base_t >::error_mixin_t ( std::string msg,
exit_codes_t exit_code )
inline

Constructs the error, naming it from derived_t.

Parameters
msgHuman-readable description.
exit_codeProcess exit code to report.

◆ error_mixin_t() [4/4]

template<typename derived_t, typename base_t>
cli::detail::error_mixin_t< derived_t, base_t >::error_mixin_t ( std::string msg,
int exit_code )
inline

Constructs the error, naming it from derived_t.

Parameters
msgHuman-readable description.
exit_codeProcess exit code to report.

The documentation for this class was generated from the following file:
  • /home/mccakit/desktop/repositories/cli11/src/error.cpp