From 1fa8f8f08735d8383469fbf64e267af952fa4bfd Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 19 Feb 2026 14:03:45 +0900 Subject: [PATCH] refactor: remove TypedField's move constructor (#4567) Apply a minor cleanup in `TypedField`: * Remove a non-working and unused move constructor. * Constrain the remaining constructor to not be overly generic enough as to be used as a copy or move constructor. --- src/ripple/protocol/SField.h | 8 +------- src/ripple/protocol/impl/SField.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ripple/protocol/SField.h b/src/ripple/protocol/SField.h index aa4d9ec52..8b013f698 100644 --- a/src/ripple/protocol/SField.h +++ b/src/ripple/protocol/SField.h @@ -275,13 +275,7 @@ struct TypedField : SField using type = T; template - explicit TypedField(Args&&... args) : SField(std::forward(args)...) - { - } - - TypedField(TypedField&& u) : SField(std::move(u)) - { - } + explicit TypedField(private_access_tag_t pat, Args&&... args); }; /** Indicate std::optional field semantics. */ diff --git a/src/ripple/protocol/impl/SField.cpp b/src/ripple/protocol/impl/SField.cpp index da8521a74..41c3a5881 100644 --- a/src/ripple/protocol/impl/SField.cpp +++ b/src/ripple/protocol/impl/SField.cpp @@ -38,6 +38,13 @@ struct SField::private_access_tag_t static SField::private_access_tag_t access; +template +template +TypedField::TypedField(private_access_tag_t pat, Args&&... args) + : SField(pat, std::forward(args)...) +{ +} + // Construct all compile-time SFields, and register them in the knownCodeToField // database: