errors 0.6.3
Loading...
Searching...
No Matches
base_error.hpp
1#pragma once
2
3#include "errors/error.hpp"
4#include "errors/source_location.hpp"
5namespace errors
6{
7namespace impl
8{
9
16class base_error : public virtual error {
17 public:
24 : loc(std::move(loc))
25 {
26 }
27
28 std::optional<source_location> location() const noexcept override
29 {
30 return this->loc;
31 }
32
33 private:
35};
36static_assert(std::is_abstract<base_error>());
37
38}
39}
Interface representing an error.
Definition error.hpp:20
A base error class.
Definition base_error.hpp:16
std::optional< source_location > location() const noexcept override
Get the source location of this error, if any.
Definition base_error.hpp:28
base_error(source_location loc)
Constructor with source_location.
Definition base_error.hpp:23
The source location.
Definition source_location.hpp:46