Skip to content

Commit 3946512

Browse files
committed
moveonly: add mp/type-void.h
1 parent 8969d5a commit 3946512

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ set(MP_PUBLIC_HEADERS
6060
include/mp/type-struct.h
6161
include/mp/type-tuple.h
6262
include/mp/type-vector.h
63+
include/mp/type-void.h
6364
include/mp/util.h)
6465
add_library(multiprocess STATIC
6566
${MP_PROXY_SRCS}

include/mp/proxy-types.h

-10
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ void ThrowField(TypeList<std::exception>, InvokeContext& invoke_context, Input&&
165165
throw std::runtime_error(std::string(CharCast(data.begin()), data.size()));
166166
}
167167

168-
template <typename LocalType, typename Output>
169-
void CustomBuildField(TypeList<LocalType>, Priority<1>, InvokeContext& invoke_context, ::capnp::Void, Output&& output)
170-
{
171-
}
172-
173168
template <typename... Values>
174169
bool CustomHasValue(InvokeContext& invoke_context, Values&&... value)
175170
{
@@ -210,11 +205,6 @@ struct ListOutput<::capnp::List<T, kind>>
210205
// clang-format on
211206
};
212207

213-
template <typename Value>
214-
::capnp::Void BuildPrimitive(InvokeContext& invoke_context, Value&&, TypeList<::capnp::Void>)
215-
{
216-
return {};
217-
}
218208
template <typename Output>
219209
void CustomBuildField(TypeList<std::exception>,
220210
Priority<1>,

include/mp/type-void.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2025 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#ifndef MP_PROXY_TYPE_VOID_H
6+
#define MP_PROXY_TYPE_VOID_H
7+
8+
#include <mp/util.h>
9+
10+
namespace mp {
11+
template <typename Value>
12+
::capnp::Void BuildPrimitive(InvokeContext& invoke_context, Value&&, TypeList<::capnp::Void>)
13+
{
14+
return {};
15+
}
16+
17+
template <typename LocalType, typename Output>
18+
void CustomBuildField(TypeList<LocalType>, Priority<1>, InvokeContext& invoke_context, ::capnp::Void, Output&& output)
19+
{
20+
}
21+
} // namespace mp
22+
23+
#endif // MP_PROXY_TYPE_VOID_H

0 commit comments

Comments
 (0)