Skip to content

Commit

Permalink
Fix Index/TextPos return type
Browse files Browse the repository at this point in the history
Needs to be explicit so they can be used before they are defined in
other translation units.
  • Loading branch information
oblivioncth committed Aug 8, 2023
1 parent b49f6e6 commit 565d252
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/core/include/qx/core/qx-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Index
// template<typename N> requires std::integral<N>
// bool operator==(const N& integer) const { return mType == Type::Value && static_cast<N>(mValue) == integer; }

auto operator<=>(const Index& other) const noexcept {
std::strong_ordering operator<=>(const Index& other) const noexcept {
switch(mType)
{
case Type::Null:
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/qx-index.dox
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace Qx
*/

/*!
* @fn auto Index<T>::operator<=>(const Index& other) const noexcept
* @fn std::strong_ordering Index<T>::operator<=>(const Index& other) const noexcept
*
* Performs a three-way comparison between this index and @a other.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/io/include/qx/io/qx-textpos.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class QX_IO_EXPORT TextPos
bool isNull() const;

bool operator==(const TextPos& other) const noexcept = default;
auto operator<=>(const TextPos& other) const noexcept;
std::strong_ordering operator<=>(const TextPos& other) const noexcept;
};

}
Expand Down
2 changes: 1 addition & 1 deletion lib/io/src/qx-textpos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TextPos::TextPos(Index32 line, Index32 character) :
* - @c 0 if this text position is equal to @a other
* - @c >0 if this text position is greater than @a other
*/
auto TextPos::operator<=>(const TextPos& other) const noexcept
std::strong_ordering TextPos::operator<=>(const TextPos& other) const noexcept
{
if (auto c = mLine <=> other.mLine; c != 0)
return c;
Expand Down

0 comments on commit 565d252

Please sign in to comment.