diff --git a/include/toolkit.h b/include/toolkit.h index 828c724..8368625 100644 --- a/include/toolkit.h +++ b/include/toolkit.h @@ -29,8 +29,15 @@ concept _num_type = requires { namespace toolkit { + enum class num_type{ + BIN, + HEX, + OCT, + DEC + } + template - std::expected to_string(T value) + inline std::expected to_string(T value) { if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) { @@ -50,7 +57,7 @@ namespace toolkit } template // requires std::is_same_v - std::expected stoi(const std::string &str) + inline std::expected stoi(const std::string &str) { T value; auto res = std::from_chars(str.c_str(), str.c_str() + str.size(), value); @@ -63,7 +70,7 @@ namespace toolkit template requires std::is_same_v || std::is_same_v - std::string replace_string(const std::string &str, T d, T e) + inline std::string replace_string(const std::string &str, T d, T e) { std::string result = str; if (d == e) @@ -93,7 +100,7 @@ namespace toolkit template requires std::is_same_v || std::is_same_v - std::vector split(T str, T d) + inline std::vector split(T str, T d) { auto v = views::split(str, d) | views::transform([](auto word) { return T(word.begin(), word.end()); });