diff --git a/src/ripple/protocol/SField.h b/src/ripple/protocol/SField.h index 5039e4e0524..253d956408f 100644 --- a/src/ripple/protocol/SField.h +++ b/src/ripple/protocol/SField.h @@ -43,7 +43,7 @@ Some fields have a different meaning for their class STAccount; class STAmount; class STBlob; -template +template class STBitString; template class STInteger; diff --git a/src/ripple/protocol/STBitString.h b/src/ripple/protocol/STBitString.h index 1819d54d1cf..45d1a3d6f05 100644 --- a/src/ripple/protocol/STBitString.h +++ b/src/ripple/protocol/STBitString.h @@ -25,9 +25,15 @@ namespace ripple { -template +// The template parameter could be an unsigned type, however there's a bug in +// gdb (last checked in gdb 12.1) that prevents gdb from finding the RTTI +// information of a template parameterized by an unsigned type. This RTTI +// information is needed to write gdb pretty printers. +template class STBitString final : public STBase { + static_assert(Bits > 0, "Number of bits must be positive"); + public: using value_type = base_uint; @@ -79,36 +85,36 @@ using STUInt128 = STBitString<128>; using STUInt160 = STBitString<160>; using STUInt256 = STBitString<256>; -template +template inline STBitString::STBitString(SField const& n) : STBase(n) { } -template +template inline STBitString::STBitString(const value_type& v) : value_(v) { } -template +template inline STBitString::STBitString(SField const& n, const value_type& v) : STBase(n), value_(v) { } -template +template inline STBitString::STBitString(SerialIter& sit, SField const& name) : STBitString(name, sit.getBitString()) { } -template +template STBase* STBitString::copy(std::size_t n, void* buf) const { return emplace(n, buf, *this); } -template +template STBase* STBitString::move(std::size_t n, void* buf) { @@ -136,14 +142,14 @@ STUInt256::getSType() const return STI_UINT256; } -template +template std::string STBitString::getText() const { return to_string(value_); } -template +template bool STBitString::isEquivalent(const STBase& t) const { @@ -151,7 +157,7 @@ STBitString::isEquivalent(const STBase& t) const return v && (value_ == v->value_); } -template +template void STBitString::add(Serializer& s) const { @@ -160,7 +166,7 @@ STBitString::add(Serializer& s) const s.addBitString(value_); } -template +template template void STBitString::setValue(base_uint const& v) @@ -168,20 +174,20 @@ STBitString::setValue(base_uint const& v) value_ = v; } -template +template typename STBitString::value_type const& STBitString::value() const { return value_; } -template +template STBitString::operator value_type() const { return value_; } -template +template bool STBitString::isDefault() const {