From 702358b5597ff3d24da9795d59e3e699fae23693 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 21 Jan 2023 11:19:39 +1100 Subject: [PATCH] Replace std::strong_ordering with auto return type to not require --- .cirrus.yml | 2 +- src/buffer.hh | 2 +- src/buffer.inl.hh | 2 +- src/keys.hh | 2 +- src/main.cc | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index b99f9458..27930b77 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -34,7 +34,7 @@ linux_task: macos_task: macos_instance: - image: ventura-base + image: ghcr.io/cirruslabs/macos-ventura-base:latest matrix: - name: macos_clang clang_script: brew install llvm@11 diff --git a/src/buffer.hh b/src/buffer.hh index 71c5cd51..7b671c0e 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -68,7 +68,7 @@ public: BufferIterator(const Buffer& buffer, BufferCoord coord) noexcept; bool operator== (const BufferIterator& iterator) const noexcept; - std::strong_ordering operator<=>(const BufferIterator& iterator) const noexcept; + auto operator<=>(const BufferIterator& iterator) const noexcept; bool operator== (const BufferCoord& coord) const noexcept; const char& operator* () const noexcept; diff --git a/src/buffer.inl.hh b/src/buffer.inl.hh index 4f6866bf..acaa699f 100644 --- a/src/buffer.inl.hh +++ b/src/buffer.inl.hh @@ -108,7 +108,7 @@ inline bool BufferIterator::operator==(const BufferIterator& iterator) const noe return m_coord == iterator.m_coord; } -inline std::strong_ordering BufferIterator::operator<=>(const BufferIterator& iterator) const noexcept +inline auto BufferIterator::operator<=>(const BufferIterator& iterator) const noexcept { kak_assert(m_buffer == iterator.m_buffer); return (m_coord <=> iterator.m_coord); diff --git a/src/keys.hh b/src/keys.hh index 2914de41..0af1a5a8 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -85,7 +85,7 @@ struct Key constexpr uint64_t val() const { return (uint64_t)modifiers << 32 | key; } constexpr bool operator==(Key other) const { return val() == other.val(); } - constexpr std::strong_ordering operator<=>(Key other) const { return val() <=> other.val(); } + constexpr auto operator<=>(Key other) const { return val() <=> other.val(); } constexpr DisplayCoord coord() const { return {(int)((key & 0xFFFF0000) >> 16), (int)(key & 0x0000FFFF)}; } constexpr MouseButton mouse_button() { return MouseButton{((int)modifiers & (int)Modifiers::MouseButtonMask) >> 6}; } diff --git a/src/main.cc b/src/main.cc index 844b4574..3e5ba370 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1092,8 +1092,7 @@ int main(int argc, char* argv[]) try { - auto show_usage = [&]() - { + auto show_usage = [&]() { write_stdout(format("Usage: {} [options] [file]... [+[:]|+:]\n\n" "Options:\n" "{}\n"