8#ifndef SEN_CORE_BASE_SOURCE_LOCATION_H
9#define SEN_CORE_BASE_SOURCE_LOCATION_H
19template <
typename T,
size_t s>
20constexpr size_t getFilenameOffset(
const T (&str)[s],
size_t i = s - 1) noexcept
22 return (str[i] ==
'/' || str[i] ==
'\\') ? i + 1 : i > 0 ? getFilenameOffset(str, i - 1) : 0;
27constexpr size_t getFilenameOffset(T (&str)[1])
noexcept
34template <
typename T, T v>
37 static constexpr const T value = v;
42#define SEN_SL_CONSTEXPR_VAL(exp) ::sen::impl::ConstexprValue<decltype(exp), exp>::value
55 std::string_view
fileName {
"file name not set"};
63 ::sen::SourceLocation \
65 std::string_view {&__FILE__[SEN_SL_CONSTEXPR_VAL(::sen::impl::getFilenameOffset(__FILE__))]}, __LINE__, \
66 std::string_view(__FUNCTION__) \
std::string_view fileName
Definition source_location.h:55
std::string_view functionName
Definition source_location.h:57
int lineNumber
Definition source_location.h:56
Represents a location in source code.
Definition source_location.h:54