112#include <msgpack/sbuffer_decl.hpp>
115#include <string_view>
116#include <type_traits>
121#define MSGPACK_FIELDS(...) \
122 void msgpack(auto pack_fn) \
124 pack_fn(NVP(__VA_ARGS__)); \
130inline constexpr std::string
camel_case(std::string_view name)
133 bool to_upper =
false;
134 for (
char c : name) {
138 if (to_upper && c >=
'a' && c <=
'z') {
139 result +=
static_cast<char>(c -
'a' +
'A');
151template <
typename T>
constexpr decltype(
auto)
unwrap_ref(T& t)
153 if constexpr (
requires { t.get(); }) {
165#define MSGPACK_CAMEL_CASE_FIELDS(...) \
166 void msgpack(auto pack_fn) \
168 auto temp_args = std::make_tuple(NVPFG(::msgpack_detail::camel_case, std::ref, __VA_ARGS__)); \
169 std::apply([&](auto&... args) { pack_fn(::msgpack_detail::unwrap_ref(args)...); }, temp_args); \
constexpr decltype(auto) unwrap_ref(T &t)
constexpr std::string camel_case(std::string_view name)