5#include <unordered_map>
10 concept SplitStringInVectorImplemented = std::same_as<T, std::string_view> || std::same_as<T, std::string>;
31 template<SplitStringInVectorImplemented T>
32 std::vector<T> splitStringInVector(
const std::string_view& s,
const std::string& separator,
bool skipEmptyStrings=
false);
40 using hash_type = std::hash<std::string_view>;
41 using is_transparent = void;
43 size_t operator()(
const char* str)
const {
return hash_type{}(str); }
44 size_t operator()(std::string_view str)
const {
return hash_type{}(str); }
45 size_t operator()(std::string
const& str)
const {
return hash_type{}(str); }
67 using string_map = std::map<std::string, T, util::string_hash, std::equal_to<>>;
Definition: utility.hpp:39
std::map< std::string, T, util::string_hash, std::equal_to<> > string_map
same as unordered_string_map, but using std::map instead of std::unordered_map
Definition: utility.hpp:67
std::unordered_map< std::string, T, util::string_hash, std::equal_to<> > unordered_string_map
A unordered_map where you can use string_views to access elements.
Definition: utility.hpp:62