Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct source_location {
- public:
- constexpr source_location(int line, const char* file, const char* function) noexcept
- : this_line(line), this_file(file), this_function(function) { }
- constexpr int line() const noexcept {
- return this_line;
- }
- constexpr const char* file() const noexcept {
- return this_file;
- }
- constexpr const char* function() const noexcept {
- return this_function;
- }
- private:
- const int this_line;
- const char* const this_file;
- const char* const this_function;
- };
- #define SOURCE_LOCATION (::source_location(__LINE__, __FILE__, "outside a function"))
- #define SOURCE_LOCATION_FN (::source_location(__LINE__, __FILE__, __func__))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement