Stax
Programming language
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1//
2// Created by tyler on 8/11/24.
3//
4
5#pragma once
6
7#include <algorithm>
8#include <string>
9
10namespace stax::utils {
11
12constexpr auto underscorify(const std::string& str) {
13 auto s = str;
14 std::ranges::replace_if(
15 s, [](const char& c) { return !std::isalpha(c); }, '_');
16 return s;
17}
18
19} // namespace stax::utils
20
21#define GET_MODULE_NAME() \
22 utils::underscorify( \
23 std::filesystem::path(std::source_location::current().file_name()) \
24 .stem())
Definition utils.hpp:10
constexpr auto underscorify(const std::string &str)
Definition utils.hpp:12