violet
Simple, cross-platform graphics API
Loading...
Searching...
No Matches
error.h
1#ifndef __VIOLET_ERROR_H__
2#define __VIOLET_ERROR_H__
3
4#include <fmt/format.h>
5
6#include <string>
7
8namespace violet {
9
10class Error {
11 public:
12 template<typename FmtStr, typename... Args>
13 Error(FmtStr&& format, Args&&... args) :
14 m_message(fmt::format(format, std::forward<Args>(args)...)) {}
15
16 std::string_view message() const {
17 return m_message;
18 }
19
20 operator std::string() const {
21 return m_message;
22 }
23
24 private:
25 std::string m_message;
26};
27
28} // namespace violet
29
30#endif
Definition error.h:10