3 ms·
Me neither. Unless I am misunderstanding the issue in the post, a simple static constexpr std::string_view filename = std::source_location::current().file_na
by menaerus 3y ago
Me neither. Unless I am misunderstanding the issue in the post, a simple
static constexpr std::string_view filename = std::source_location::current().file_name();
static_assert(filename == "whatever_the_name_of_file_is");
static_assert(filename.length() == 28);
will do. Both the filename and filename length is available in the compile-time.