1#ifndef OF_FIXEDSTRING_HPP
2#define OF_FIXEDSTRING_HPP
10 template <
size_t Size>
18 assert(str !=
nullptr);
19 const auto len = strlen(str);
21 memcpy(data, str, len);
31 return strcmp(data, other.data) == 0;
34 std::string_view
view()
const
36 return std::string_view(data);
45struct std::hash<
OF::FixedString<Size>>
49 return hash<string_view>{}(k.
view());
FixedString(const char *str)
定义 FixedString.hpp:16
std::string_view view() const
定义 FixedString.hpp:34
FixedString()
定义 FixedString.hpp:14
bool operator==(const FixedString &other) const
定义 FixedString.hpp:29
FixedString(const std::string &str)
定义 FixedString.hpp:25
size_t operator()(const OF::FixedString< Size > &k) const
定义 FixedString.hpp:47