17#ifndef TOOLBOX_UTIL_STRINGBUF_HPP
18#define TOOLBOX_UTIL_STRINGBUF_HPP
23#include <boost/container_hash/hash.hpp>
26inline namespace util {
29template <std::
size_t MaxN>
32 template <std::
size_t MaxR>
65 template <std::
size_t MaxR>
85 template <
typename TypeT>
88 return compare(
rhs.data(),
rhs.size());
90 template <
typename TypeT>
93 return size() ==
rhs.size() && compare(
rhs.data(),
rhs.size()) == 0;
101#pragma GCC diagnostic push
102#pragma GCC diagnostic ignored "-Wnonnull"
103 std::memcpy(buf_,
rdata, len_);
104#pragma GCC diagnostic pop
115 auto compare(
const char*
rdata, std::size_t
rlen)
const noexcept
129template <std::
size_t MaxN>
132 return {
s.data(),
s.size()};
135template <std::
size_t MaxN>
145template <std::
size_t MaxN>
146struct hash<
toolbox::util::StringBuf<MaxN>> {
150 boost::hash_combine(h, +key);
ostream & operator<<(ostream &os, const pair< T, U > &p)