Skip to content

Commit

Permalink
refactor: remove TypedField's move constructor (XRPLF#4567)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HowardHinnant authored and ckeshava committed Jul 10, 2023
1 parent 238a248 commit 8520356
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/ripple/protocol/SField.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,7 @@ struct TypedField : SField
using type = T;

template <class... Args>
explicit TypedField(Args&&... args) : SField(std::forward<Args>(args)...)
{
}

TypedField(TypedField&& u) : SField(std::move(u))
{
}
explicit TypedField(private_access_tag_t pat, Args&&... args);
};

/** Indicate std::optional field semantics. */
Expand Down
7 changes: 7 additions & 0 deletions src/ripple/protocol/impl/SField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ struct SField::private_access_tag_t

static SField::private_access_tag_t access;

template <class T>
template <class... Args>
TypedField<T>::TypedField(private_access_tag_t pat, Args&&... args)
: SField(pat, std::forward<Args>(args)...)
{
}

// Construct all compile-time SFields, and register them in the knownCodeToField
// database:

Expand Down

0 comments on commit 8520356

Please sign in to comment.