diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-17 21:47:17 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-17 21:47:30 +0200 |
| commit | 130bf594d1b73c471591f4b8c79b7280f2fb0df6 (patch) | |
| tree | 6c58fca93477211f03c62babf9e1d54d7d74143c | |
| parent | 64da638ee700fba2d51eabc6a2e070adef823a12 (diff) | |
bptr: get rid of <compare>
| -rw-r--r-- | compat/borrowed-ptr.hpp | 5 | ||||
| -rw-r--r-- | compat/borrowed-ptr.inl | 10 | ||||
| -rw-r--r-- | src/chunk-render.cpp | 2 | ||||
| -rw-r--r-- | src/chunk-walls.cpp | 2 |
4 files changed, 2 insertions, 17 deletions
diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp index 6a4e79f1..76039926 100644 --- a/compat/borrowed-ptr.hpp +++ b/compat/borrowed-ptr.hpp @@ -1,6 +1,5 @@ #pragma once #include "borrowed-ptr-fwd.hpp" -#include <compare> #define FM_BPTR_DEBUG #define FM_NO_WEAK_BPTR @@ -113,10 +112,6 @@ public: bool operator==(const bptr<T>& other) const noexcept requires (!std::is_const_v<T>); bool operator==(const std::nullptr_t& other) const noexcept; - std::strong_ordering operator<=>(const bptr<const T>& other) const noexcept; - std::strong_ordering operator<=>(const bptr<T>& other) const noexcept requires (!std::is_const_v<T>); - std::strong_ordering operator<=>(const std::nullptr_t&) const noexcept; - template<typename U> friend class bptr; template<typename U> friend class weak_bptr; diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl index 2ae1226b..d8c561a5 100644 --- a/compat/borrowed-ptr.inl +++ b/compat/borrowed-ptr.inl @@ -148,16 +148,6 @@ template<typename T> bool bptr<T>::operator==(const bptr<T>& other) const noexce template<typename T> bool bptr<T>::operator==(const std::nullptr_t&) const noexcept { return !blk || !blk->_ptr; } -template<typename T> -std::strong_ordering bptr<T>::operator<=>(const bptr<const T>& other) const noexcept -{ return get() <=> other.get(); } - -template<typename T> std::strong_ordering bptr<T>::operator<=>(const bptr<T>& other) const noexcept requires (!std::is_const_v<T>) -{ return get() <=> other.get(); } - -template<typename T> std::strong_ordering bptr<T>::operator<=>(const std::nullptr_t&) const noexcept -{ return get() <=> (T*)nullptr; } - template<typename T> void bptr<T>::swap(bptr& other) noexcept { floormat::swap(blk, other.blk); } template<typename T> diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp index 529d4f64..0cc88af2 100644 --- a/src/chunk-render.cpp +++ b/src/chunk-render.cpp @@ -54,7 +54,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple std::sort(_ground->indexes.begin(), _ground->indexes.begin() + count, [this](uint8_t a, uint8_t b) { - return _ground->atlases[a] < _ground->atlases[b]; + return _ground->atlases[a].get() < _ground->atlases[b].get(); }); float hack_offset = _coord.z <= 0 ? -16.f : 0.f; // XXX hack diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp index fb4b6560..6e7ff531 100644 --- a/src/chunk-walls.cpp +++ b/src/chunk-walls.cpp @@ -309,7 +309,7 @@ GL::Mesh chunk::make_wall_mesh() [&A = _walls->atlases](const auto& a, const auto& b) { const auto& [av, ai] = a; const auto& [bv, bi] = b; - return A[ai] < A[bi]; + return A[ai].get() < A[bi].get(); }); auto vertex_view = std::as_const(vertexes).prefix(N); |
