Skip to content

Commit

Permalink
Address two of the TODOs
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Feb 3, 2025
1 parent d67df46 commit f904bdd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/engine/idTable/IdTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,14 @@ class IdTable {
// `auto newTable = AD_FWD(oldTable).moveOrClone()` which is equivalent to the
// pattern `auto newX = AD_FWD(oldX)` where the type is copy-constructible
// (which `IdTable` is not.).
// TODO: <ccoecontrol> what with this one?
// reimplementing it with CPP_template macro causes template redefinition
// errors
auto moveOrClone() const& requires isCloneable { return clone(); }
IdTable&& moveOrClone() && requires isCloneable { return std::move(*this); }
CPP_template(typename = void)(
requires(isCloneable)) auto moveOrClone() const& {
return clone();
}
CPP_template(typename = void)(
requires(isCloneable)) IdTable&& moveOrClone() && {
return std::move(*this);
}

// Overload of `clone` for `Storage` types that are not copy constructible.
// It requires a preconstructed but empty argument of type `Storage` that
Expand Down
4 changes: 2 additions & 2 deletions src/engine/idTable/IdTableRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ class RowReferenceImpl {
public:
// Swap two `RowReference`s, but only if they are temporaries (rvalues).
// This modifies the underlying table.
// TODO: <ccoecontrol> what about this?
friend void swap(This&& a, This&& b) requires(!isConst) {
CPP_template(typename = void)(requires CPP_NOT(isConst)) friend void swap(
This&& a, This&& b) {
return swapImpl(a, b);
}

Expand Down

0 comments on commit f904bdd

Please sign in to comment.