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 "
barretenberg/common/try_catch_shim.hpp
"
4
#include "
msgpack.hpp
"
5
#include "
msgpack_impl/drop_keys.hpp
"
6
7
namespace
msgpack
{
11
template
<msgpack_concepts::HasMsgPack T>
void
msgpack_apply
(
const
auto
& func,
auto
&... args)
12
{
13
std::apply(func,
msgpack::drop_keys
(std::tie(args...)));
14
}
20
template
<msgpack_concepts::HasMsgPack T>
void
msgpack_apply
(
const
T&
value
,
const
auto
& func)
21
{
22
// We must use const_cast as our method is meant to be polymorphic over const, but there's no such concept in C++
23
const_cast<
T&
>
(
value
).
msgpack
([&](
auto
&... args) {
// NOLINT
24
msgpack_apply<T>(func, args...);
25
});
26
}
27
}
// namespace msgpack
drop_keys.hpp
msgpack.hpp
msgpack
Definition
msgpack_apply.hpp:7
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:11
value
FF value
Definition
public_data_tree.test.cpp:97
try_catch_shim.hpp
src
barretenberg
serialize
msgpack_apply.hpp
Generated by
1.9.8