Skip to content

Commit

Permalink
#4748 - Since this is the first record of the C++20 spaceship operato…
Browse files Browse the repository at this point in the history
…r<=>, add comments
  • Loading branch information
jmarrec committed Mar 17, 2023
1 parent 24afa3d commit 8cd3b48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utilities/bcl/BCLFileReference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class UTILITIES_API BCLFileReference
//@}

protected:
// Declaring the equality operator and the spaceship operator (three-way comparison operator) will end up defining all comparison operators
// We really need only the operator< for sorting a STL container of BCLFileReference, but might as well be consistent
// Comparison is done on m_path. Sorting is useful for BCLXML to avoid reordering of files (see #4748)
friend bool operator==(const BCLFileReference& lhs, const BCLFileReference& rhs);
friend std::strong_ordering operator<=>(const BCLFileReference& lhs, const BCLFileReference& rhs);

Expand Down

0 comments on commit 8cd3b48

Please sign in to comment.