errors 0.6.3
Loading...
Searching...
No Matches
errors::error_ptr Class Reference

Smart pointer to errors::error with some utility member functions. More...

#include <errors/error_ptr.hpp>

Inheritance diagram for errors::error_ptr:
Collaboration diagram for errors::error_ptr:

Public Member Functions

template<typename E >
bool is () const
 Check if the error is caused by some kind of errors::error recursively.
 
template<typename E >
const E * as () const
 Looking up error in causes.
 
template<typename E >
E * as ()
 Looking up error in causes.
 

Detailed Description

Smart pointer to errors::error with some utility member functions.

Examples
examples/basic-usage/src/main.cpp.

Member Function Documentation

◆ as() [1/2]

template<typename E >
E * errors::error_ptr::as ( )
inlinenodiscard

Looking up error in causes.

Template Parameters
EType of error to looking for.
Returns
A pointer to E if this error is caused by an instance of error E, nullptr otherwise.

Examines the cause link list, looking for the first error which can be referenced by E.

◆ as() [2/2]

template<typename E >
const E * errors::error_ptr::as ( ) const
inlinenodiscard

Looking up error in causes.

Template Parameters
EType of error to looking for.
Returns
A pointer to E if this error is caused by an instance of error E, nullptr otherwise.

Examines the cause link list, looking for the first error which can be referenced by E.

◆ is()

template<typename E >
bool errors::error_ptr::is ( ) const
inlinenodiscard

Check if the error is caused by some kind of errors::error recursively.

Template Parameters
EType of error to check.
Returns
true if the error is caused by an instance of error E, false otherwise.

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