Skip to content

Commit 634702f

Browse files
committed
Fix invalid constexpr.
1 parent 8f70e9f commit 634702f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/bitcoin/system/chain/witness.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class BC_API witness
126126
private:
127127
// TODO: move to config serialization wrapper.
128128
static witness from_string(const std::string& mnemonic) NOEXCEPT;
129-
static constexpr size_t element_size(const chunk_cptr& element) NOEXCEPT;
130129
static constexpr bool is_annex_pattern(const chunk_cptrs& stack) NOEXCEPT;
130+
static inline size_t element_size(const chunk_cptr& element) NOEXCEPT;
131131
static inline bool drop_annex(chunk_cptrs& stack) NOEXCEPT;
132132

133133
void assign_data(reader& source, bool prefix) NOEXCEPT;

include/bitcoin/system/impl/chain/witness.ipp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ namespace chain {
2929
BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED)
3030
BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR)
3131

32-
// static/private
33-
constexpr size_t witness::element_size(const chunk_cptr& element) NOEXCEPT
34-
{
35-
// Each witness is prefixed with number of elements [bip144].
36-
const auto size = element->size();
37-
return ceilinged_add(variable_size(size), size);
38-
};
39-
4032
// static
4133
constexpr bool witness::is_push_size(const chunk_cptrs& stack) NOEXCEPT
4234
{
@@ -82,6 +74,14 @@ inline bool witness::drop_annex(chunk_cptrs& stack) NOEXCEPT
8274
return false;
8375
}
8476

77+
// static/private
78+
inline size_t witness::element_size(const chunk_cptr& element) NOEXCEPT
79+
{
80+
// Each witness is prefixed with number of elements [bip144].
81+
const auto size = element->size();
82+
return ceilinged_add(variable_size(size), size);
83+
};
84+
8585
BC_POP_WARNING()
8686
BC_POP_WARNING()
8787

0 commit comments

Comments
 (0)