#ifndef YERBACON_HPP #define YERBACON_HPP #ifndef YBCON_VERSION #warning "YBCON_VERSION is unknown and will therefore be set to a default value" #define YBCON_VERSION "UNKNOWN" #endif #ifdef __STDC_NO_THREADS__ #error "A valid std::threads implementation is required" #endif #include #if not defined(__cpp_lib_concepts) || not defined(__cpp_lib_integer_comparison_functions) #error "The current standard library is incomplete" #endif #ifndef __cpp_using_enum #error "The "using enum" syntax is not supported by this compiler" #endif #include #include #include #include namespace Yerbacon { consteval const char* getVersion() noexcept { return YBCON_VERSION; } class Exception: public std::exception { std::string exceptionCause; public: [[nodiscard]] const char* what() const noexcept final { return exceptionCause.data(); } explicit Exception(const std::string_view& cause): exceptionCause(cause) {} Exception(const std::string_view& cause, unsigned long line): Exception(('L' + std::to_string(line) + ": ").append(cause)) {} }; } #undef YBCON_VERSION #endif