9inline auto replace_all(std::string str, std::string_view from,
const std::string_view to) -> std::string {
11 while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
12 str.replace(start_pos, from.length(), to);
13 start_pos += to.length();
28template <
class T>
constexpr auto type_name() -> std::string_view {
32 string_view p = __PRETTY_FUNCTION__;
34 return {p.data() + 34, p.size() - 34 - 1};
35#elif defined(__GNUC__)
36 string_view p = __PRETTY_FUNCTION__;
37#if __cplusplus < 201402
38 return {p.data() + 36, p.size() - 36 - 1};
40 return {p.data() + 49, p.find(
';', 49) - 49};
42#elif defined(_MSC_VER)
43 string_view p = __FUNCSIG__;
44 return {p.data() + 84, p.size() - 84 - 7};
auto replace_all(std::string str, std::string_view from, const std::string_view to) -> std::string
Replace all occurrences of from by to in str.
Definition debug.hh:9