Skip to content

Commit 486990c

Browse files
authored
Merge pull request #1601 from evoskuil/master
Remove obsolete workaround for lack of std::views::reverse.
2 parents aa8a735 + a31f722 commit 486990c

35 files changed

Lines changed: 120 additions & 219 deletions

include/bitcoin/system/boost.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@
5555
////#include <boost/predef.h> // platform identifications
5656
#include <boost/program_options.hpp>
5757

58-
// C++20 suport for ranges not yet available on other platforms.
59-
#if defined(HAVE_RANGES)
60-
#include <ranges>
61-
#define views_reverse std::views::reverse
62-
#else
63-
// boost::adaptors::reverse is not constexpr.
64-
#include <boost/range/adaptor/reversed.hpp>
65-
#define views_reverse boost::adaptors::reverse
66-
#endif
67-
6858
// ADL free functions for use with boost-json.
6959
#define DECLARE_JSON_VALUE_CONVERTORS(name) \
7060
BC_API name tag_invoke(boost::json::value_to_tag<name>, \

include/bitcoin/system/chain/operation.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class BC_API operation
4848
static constexpr opcode opcode_from_version(uint8_t value) NOEXCEPT;
4949
static constexpr opcode opcode_from_positive(uint8_t value) NOEXCEPT;
5050

51-
static VCONSTEXPR opcode minimal_opcode_from_data(
51+
static constexpr opcode minimal_opcode_from_data(
5252
const data_chunk& data) NOEXCEPT;
53-
static VCONSTEXPR opcode nominal_opcode_from_data(
53+
static constexpr opcode nominal_opcode_from_data(
5454
const data_chunk& data) NOEXCEPT;
5555

5656
/// Categories of opcodes.

include/bitcoin/system/chain/script.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@ class BC_API script
5050

5151
/// Determine if the flag is enabled in the active flags set.
5252
static constexpr bool is_enabled(uint32_t active_flags, flags flag) NOEXCEPT;
53-
static VCONSTEXPR bool is_push_only_pattern(const operations& ops) NOEXCEPT;
54-
static VCONSTEXPR bool is_relaxed_push_pattern(const operations& ops) NOEXCEPT;
55-
static VCONSTEXPR bool is_commitment_pattern(const operations& ops) NOEXCEPT;
56-
static VCONSTEXPR bool is_witness_program_pattern(const operations& ops) NOEXCEPT;
57-
static VCONSTEXPR bool is_pay_null_data_pattern(const operations& ops) NOEXCEPT;
58-
static VCONSTEXPR bool is_pay_op_return_pattern(const operations& ops) NOEXCEPT;
59-
static VCONSTEXPR bool is_pay_multisig_pattern(const operations& ops) NOEXCEPT;
60-
static VCONSTEXPR bool is_pay_public_key_pattern(const operations& ops) NOEXCEPT;
61-
static VCONSTEXPR bool is_pay_key_hash_pattern(const operations& ops) NOEXCEPT;
62-
static VCONSTEXPR bool is_pay_script_hash_pattern(const operations& ops) NOEXCEPT;
63-
static VCONSTEXPR bool is_pay_witness_pattern(const operations& ops) NOEXCEPT;
64-
static VCONSTEXPR bool is_pay_witness_key_hash_pattern(const operations& ops) NOEXCEPT;
65-
static VCONSTEXPR bool is_pay_witness_script_hash_pattern(const operations& ops) NOEXCEPT;
66-
static VCONSTEXPR bool is_sign_multisig_pattern(const operations& ops) NOEXCEPT;
67-
static VCONSTEXPR bool is_sign_public_key_pattern(const operations& ops) NOEXCEPT;
68-
static VCONSTEXPR bool is_sign_key_hash_pattern(const operations& ops) NOEXCEPT;
69-
static VCONSTEXPR bool is_sign_script_hash_pattern(const operations& ops) NOEXCEPT;
53+
static constexpr bool is_push_only_pattern(const operations& ops) NOEXCEPT;
54+
static constexpr bool is_relaxed_push_pattern(const operations& ops) NOEXCEPT;
55+
static constexpr bool is_commitment_pattern(const operations& ops) NOEXCEPT;
56+
static constexpr bool is_witness_program_pattern(const operations& ops) NOEXCEPT;
57+
static constexpr bool is_pay_null_data_pattern(const operations& ops) NOEXCEPT;
58+
static constexpr bool is_pay_op_return_pattern(const operations& ops) NOEXCEPT;
59+
static constexpr bool is_pay_multisig_pattern(const operations& ops) NOEXCEPT;
60+
static constexpr bool is_pay_public_key_pattern(const operations& ops) NOEXCEPT;
61+
static constexpr bool is_pay_key_hash_pattern(const operations& ops) NOEXCEPT;
62+
static constexpr bool is_pay_script_hash_pattern(const operations& ops) NOEXCEPT;
63+
static constexpr bool is_pay_witness_pattern(const operations& ops) NOEXCEPT;
64+
static constexpr bool is_pay_witness_key_hash_pattern(const operations& ops) NOEXCEPT;
65+
static constexpr bool is_pay_witness_script_hash_pattern(const operations& ops) NOEXCEPT;
66+
static constexpr bool is_sign_multisig_pattern(const operations& ops) NOEXCEPT;
67+
static constexpr bool is_sign_public_key_pattern(const operations& ops) NOEXCEPT;
68+
static constexpr bool is_sign_key_hash_pattern(const operations& ops) NOEXCEPT;
69+
static constexpr bool is_sign_script_hash_pattern(const operations& ops) NOEXCEPT;
7070
static bool is_coinbase_pattern(const operations& ops, size_t height) NOEXCEPT;
7171

7272
static inline operations to_pay_null_data_pattern(

include/bitcoin/system/chain/witness.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class BC_API witness
9898
/// Skip a witness (as if deserialized).
9999
static void skip(reader& source, bool prefix) NOEXCEPT;
100100

101-
static VCONSTEXPR bool is_push_size(const chunk_cptrs& stack) NOEXCEPT
101+
static constexpr bool is_push_size(const chunk_cptrs& stack) NOEXCEPT
102102
{
103103
return std::all_of(stack.begin(), stack.end(),
104104
[](const auto& element) NOEXCEPT
@@ -108,7 +108,7 @@ class BC_API witness
108108
}
109109

110110
/// The (only) coinbase witness must be (arbitrary) 32-byte value (bip141).
111-
static VCONSTEXPR bool is_reserved_pattern(const chunk_cptrs& stack) NOEXCEPT
111+
static constexpr bool is_reserved_pattern(const chunk_cptrs& stack) NOEXCEPT
112112
{
113113
return is_one(stack.size()) && stack.front()->size() == hash_size;
114114
}

include/bitcoin/system/data/data_reference.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ class data_reference
5858
constexpr data_reference(const data_slice& data) NOEXCEPT;
5959

6060
/// std::string constructor (casts char to uint8_t).
61-
SCONSTEXPR data_reference(const std::string& text) NOEXCEPT;
61+
constexpr data_reference(const std::string& text) NOEXCEPT;
6262

6363
/// data_chunk constructor.
64-
VCONSTEXPR data_reference(const data_chunk& data) NOEXCEPT;
64+
constexpr data_reference(const data_chunk& data) NOEXCEPT;
6565

6666
/// data_array constructor.
6767
template <size_type Size>
@@ -73,7 +73,7 @@ class data_reference
7373

7474
/// Byte vector constructor (casts Byte to uint8_t).
7575
template <typename Byte, if_one_byte<Byte> = true>
76-
VCONSTEXPR data_reference(const std_vector<Byte>& data) NOEXCEPT;
76+
constexpr data_reference(const std_vector<Byte>& data) NOEXCEPT;
7777

7878
/// Byte iterators constructor (casts to uint8_t).
7979
template <typename Iterator>

include/bitcoin/system/data/data_slab.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class data_slab
7070
// TODO: test.
7171
/// Byte vector constructor (casts Byte to uint8_t).
7272
template <typename Byte, if_one_byte<Byte> = true>
73-
VCONSTEXPR data_slab(std_vector<Byte>& data) NOEXCEPT;
73+
constexpr data_slab(std_vector<Byte>& data) NOEXCEPT;
7474

7575
// TODO: restrict to iterator-to-non-const references.
7676
/// Byte iterators constructor (casts to uint8_t).
@@ -84,7 +84,7 @@ class data_slab
8484

8585
// TODO: test.
8686
/// String constructor (casts char to uint8_t).
87-
SCONSTEXPR data_slab(std::string& text) NOEXCEPT;
87+
constexpr data_slab(std::string& text) NOEXCEPT;
8888

8989
/// Methods.
9090
/// -----------------------------------------------------------------------
@@ -98,7 +98,7 @@ class data_slab
9898
inline std_vector<value_type> to_chunk() const NOEXCEPT;
9999

100100
/// Convert data to a string (casts uint8_t to char).
101-
SCONSTEXPR std::string to_string() const NOEXCEPT;
101+
constexpr std::string to_string() const NOEXCEPT;
102102

103103
/// Cast buffer to a data_slice.
104104
constexpr data_slice to_slice() const NOEXCEPT;
@@ -122,7 +122,7 @@ class data_slab
122122
/// -----------------------------------------------------------------------
123123
////template<size_type Size>
124124
////constexpr operator std_array<value_type, Size>() const NOEXCEPT;
125-
////VCONSTEXPR operator std_vector<value_type>() const NOEXCEPT;
125+
////constexpr operator std_vector<value_type>() const NOEXCEPT;
126126
constexpr operator data_slice() const NOEXCEPT;
127127
constexpr value_type operator[](size_type index) const NOEXCEPT;
128128

@@ -139,7 +139,7 @@ class data_slab
139139
size_type size) NOEXCEPT;
140140

141141
template <typename Pointer>
142-
static SVCONSTEXPR data_slab from_size_(const Pointer begin,
142+
static constexpr data_slab from_size_(const Pointer begin,
143143
size_type size) NOEXCEPT;
144144

145145
pointer begin_;

include/bitcoin/system/data/data_slice.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class data_slice
7979

8080
/// Byte vector constructor (casts Byte to uint8_t).
8181
template <typename Byte, if_one_byte<Byte> = true>
82-
VCONSTEXPR data_slice(const std_vector<Byte>& data) NOEXCEPT;
82+
constexpr data_slice(const std_vector<Byte>& data) NOEXCEPT;
8383

8484
// TODO: restrict to iterator-to-const references.
8585
/// Byte iterators constructor (casts to uint8_t).
@@ -92,10 +92,10 @@ class data_slice
9292
constexpr data_slice(const Byte* begin, const Byte* end) NOEXCEPT;
9393

9494
/// String constructor (casts char to uint8_t).
95-
SCONSTEXPR data_slice(const std::string& text) NOEXCEPT;
95+
constexpr data_slice(const std::string& text) NOEXCEPT;
9696

9797
/// Byte initializer list constructor.
98-
SVCONSTEXPR data_slice(std::initializer_list<value_type> bytes) NOEXCEPT;
98+
constexpr data_slice(std::initializer_list<value_type> bytes) NOEXCEPT;
9999

100100
/// Methods.
101101
/// -----------------------------------------------------------------------
@@ -109,7 +109,7 @@ class data_slice
109109
inline std_vector<value_type> to_chunk() const NOEXCEPT;
110110

111111
/// Convert data to a string (casts uint8_t to char).
112-
SCONSTEXPR std::string to_string() const NOEXCEPT;
112+
constexpr std::string to_string() const NOEXCEPT;
113113

114114
/// Resize the slice by decrementing the end pointer.
115115
/// This is the only mutable action that can be taken on the slice.
@@ -130,7 +130,7 @@ class data_slice
130130
/// -----------------------------------------------------------------------
131131
////template<size_type Size>
132132
////constexpr operator std_array<value_type, Size>() const NOEXCEPT;
133-
////VCONSTEXPR operator std_vector<value_type>() const NOEXCEPT;
133+
////constexpr operator std_vector<value_type>() const NOEXCEPT;
134134
constexpr value_type operator[](size_type index) const NOEXCEPT;
135135

136136
private:
@@ -149,7 +149,7 @@ class data_slice
149149
Pointer begin, size_type size) NOEXCEPT;
150150

151151
template <typename Pointer>
152-
static SVCONSTEXPR data_slice from_size_(
152+
static constexpr data_slice from_size_(
153153
Pointer begin, size_type size) NOEXCEPT;
154154

155155
pointer begin_;

include/bitcoin/system/data/exclusive_slice.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class exclusive_slice
5959
{
6060
}
6161

62-
SCONSTEXPR exclusive_slice(const std::string& text) NOEXCEPT
62+
constexpr exclusive_slice(const std::string& text) NOEXCEPT
6363
: data_slice(text)
6464
{
6565
}
6666

67-
SVCONSTEXPR exclusive_slice(std::initializer_list<value_type> bytes) NOEXCEPT
67+
constexpr exclusive_slice(std::initializer_list<value_type> bytes) NOEXCEPT
6868
: data_slice(bytes.begin(), bytes.end())
6969
{
7070
}

include/bitcoin/system/data/string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace system {
3131
/// Casts bytes directly into the string member.
3232
/// to_string(to_chunk(string)) == string.
3333
/// to_string(to_array(string)) == string.
34-
SCONSTEXPR std::string to_string(const data_slice& bytes) NOEXCEPT
34+
constexpr std::string to_string(const data_slice& bytes) NOEXCEPT
3535
{
3636
return bytes.to_string();
3737
}

include/bitcoin/system/endian/integers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ constexpr Integer from_big_array(size_t length,
5050
const data_array<Size>& data) NOEXCEPT;
5151

5252
template <typename Integer, if_integer<Integer> = true>
53-
VCONSTEXPR Integer from_big_chunk(size_t length,
53+
constexpr Integer from_big_chunk(size_t length,
5454
const data_chunk& data) NOEXCEPT;
5555

5656
/// Native endianness integer from little-endian data.
@@ -65,7 +65,7 @@ constexpr Integer from_little_array(size_t length,
6565
const data_array<Size>& data) NOEXCEPT;
6666

6767
template <typename Integer, if_integer<Integer> = true>
68-
VCONSTEXPR Integer from_little_chunk(size_t length,
68+
constexpr Integer from_little_chunk(size_t length,
6969
const data_chunk& data) NOEXCEPT;
7070

7171
} // namespace system

0 commit comments

Comments
 (0)