|
Porytiles
|
A wrapper for std::string_view with a taggable std::source_location. More...
#include <panic.hpp>
Public Member Functions | |
| template<class T > requires std::constructible_from<std::string_view, T> | |
| StringViewSourceLoc (const T &msg, const std::source_location loc=std::source_location::current()) noexcept | |
| Constructs a StringViewSourceLoc with a message and optional source location. | |
Public Attributes | |
| std::string_view | msg_ |
| std::source_location | loc_ |
A wrapper for std::string_view with a taggable std::source_location.
This struct combines a message with source location information for debugging and error reporting. It automatically captures the source location at the point of construction when used with the default parameter. Inspired by: https://buildingblock.ai/panic
|
inlinenoexcept |
Constructs a StringViewSourceLoc with a message and optional source location.
The constructor accepts any type that can be converted to std::string_view and automatically captures the source location if not explicitly provided.
| T | Type that can be constructed into std::string_view |
| msg | The message to store |
| loc | The source location (defaults to current location) |