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__;
33 return {p.data() + 34, p.size() - 34 - 1};
34#elif defined(__GNUC__)
35 string_view p = __PRETTY_FUNCTION__;
36#if __cplusplus < 201402
37 return {p.data() + 36, p.size() - 36 - 1};
39 return {p.data() + 49, p.find(
';', 49) - 49};
41#elif defined(_MSC_VER)
42 string_view p = __FUNCSIG__;
43 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