66struct BufferFormatter<std::string> {
67 using CharFormatter = BufferFormatter<
const char*>;
68 const std::string& value;
70 explicit BufferFormatter(
const std::string& val) : value{val} {}
71 template <
typename Buffer>
72 void operator()(
const UserTypes&, Buffer& buf)
const {
73 CharFormatter::WriteN(buf, value.data(), value.size());
90struct BufferFormatter<std::string_view> : detail::BufferFormatterBase<std::string_view> {
91 using BaseType = detail::BufferFormatterBase<std::string_view>;
92 using CharFormatter = BufferFormatter<
const char*>;
94 using BaseType::BaseType;
96 template <
typename Buffer>
97 void operator()(
const UserTypes&, Buffer& buffer)
const {
98 CharFormatter::WriteN(buffer, value.data(), value.size());