Skip to content

Commit 91219de

Browse files
authored
Merge pull request #1740 from evoskuil/master
Move overload definition to types.
2 parents 56bd44f + 378f2a1 commit 91219de

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

include/bitcoin/system/define.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <stdexcept> // purged
3333
#include <string> // purged
3434
#include <type_traits> // purged
35+
#include <variant> // purged
3536
#include <vector> // purged
3637

3738
// Pulls in all /system headers (except settings.hpp).

include/bitcoin/system/impl/machine/stack_variant.ipp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include <tuple>
2323
#include <utility>
24-
#include <variant>
2524
#include <bitcoin/system/data/data.hpp>
2625
#include <bitcoin/system/define.hpp>
2726
#include <bitcoin/system/math/math.hpp>

include/bitcoin/system/machine/stack.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#define LIBBITCOIN_SYSTEM_MACHINE_STACK_HPP
2121

2222
#include <list>
23-
#include <variant>
2423
#include <bitcoin/system/data/data.hpp>
2524
#include <bitcoin/system/define.hpp>
2625
#include <bitcoin/system/machine/number_boolean.hpp>
@@ -110,14 +109,6 @@ class stack
110109
mutable tether<data_chunk> tether_;
111110
};
112111

113-
// For use with std::visit.
114-
template<class... Overload>
115-
struct overload : Overload... { using Overload::operator()...; };
116-
117-
// clang++16 still requires.
118-
// Explicit deduction guide, should not be required in C++20 (namespace scope).
119-
template<class... Overload> overload(Overload...) -> overload<Overload...>;
120-
121112
} // namespace machine
122113
} // namespace system
123114
} // namespace libbitcoin

include/bitcoin/system/types.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#define LIBBITCOIN_SYSTEM_TYPES_HPP
2121

2222
#include <tuple>
23+
#include <variant>
2324
#include <bitcoin/system/allocator.hpp>
2425

2526
namespace libbitcoin {
@@ -201,6 +202,16 @@ struct text_t
201202
BC_POP_WARNING()
202203
BC_POP_WARNING()
203204

205+
/// Overload pattern.
206+
/// ---------------------------------------------------------------------------
207+
/// For use with std::visit.
208+
template<class... Overload>
209+
struct overload : Overload... { using Overload::operator()...; };
210+
211+
/// clang++16 still requires.
212+
/// Explicit deduction guide, should not be required in C++20 (namespace scope).
213+
template<class... Overload> overload(Overload...) -> overload<Overload...>;
214+
204215
/// Argument placeholders.
205216
/// ---------------------------------------------------------------------------
206217

0 commit comments

Comments
 (0)