errors 0.6.3
Loading...
Searching...
No Matches
error_without_cause.hpp
1#pragma once
2
3#include "errors/error_ptr.hpp"
4#include "errors/impl/base_error.hpp"
5
6namespace errors
7{
8namespace impl
9{
10
19 public:
21
22 const error_ptr &cause() const & noexcept override
23 {
24 static error_ptr null;
25 return null;
26 }
27
28 error_ptr cause() && noexcept override
29 {
30 return nullptr;
31 }
32};
33static_assert(std::is_abstract<error_without_cause>());
34
35}
36}
Smart pointer to errors::error with some utility member functions.
Definition error_ptr.hpp:13
A base error class.
Definition base_error.hpp:16
base_error(source_location loc)
Constructor with source_location.
Definition base_error.hpp:23
A base error class.
Definition error_without_cause.hpp:18
const error_ptr & cause() const &noexcept override
Get cause of this error, if any.
Definition error_without_cause.hpp:22
error_ptr cause() &&noexcept override
Transfer the ownership of cause of this error, if any.
Definition error_without_cause.hpp:28