Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
msgpack_apply.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
msgpack.hpp
"
4
#include "
msgpack_impl/drop_keys.hpp
"
5
6
namespace
msgpack
{
10
template
<msgpack_concepts::HasMsgPack T>
void
msgpack_apply
(
const
auto
& func,
auto
&... args)
11
{
12
std::apply(func,
msgpack::drop_keys
(std::tie(args...)));
13
}
19
template
<msgpack_concepts::HasMsgPack T>
void
msgpack_apply
(
const
T&
value
,
const
auto
& func)
20
{
21
// We must use const_cast as our method is meant to be polymorphic over const, but there's no such concept in C++
22
const_cast<
T&
>
(
value
).
msgpack
([&](
auto
&... args) {
// NOLINT
23
msgpack_apply<T>(func, args...);
24
});
25
}
26
}
// namespace msgpack
drop_keys.hpp
msgpack.hpp
msgpack
Definition
msgpack_apply.hpp:6
msgpack::drop_keys
auto drop_keys(std::tuple< Args... > &&tuple)
Drops every first value pairwise of a flat argument tuple, assuming that they are keys.
Definition
drop_keys.hpp:15
msgpack::msgpack_apply
void msgpack_apply(const auto &func, auto &... args)
Helper method for better error reporting. Clang does not give the best errors for lambdas.
Definition
msgpack_apply.hpp:10
value
FF value
Definition
public_data_tree.test.cpp:96
src
barretenberg
serialize
msgpack_apply.hpp
Generated by
1.9.8