From 54b5ac6389f65d415dcd406be51cfe0e6c416778 Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sun, 3 Nov 2024 17:33:51 +0900 Subject: [PATCH] Lipsticks Signed-off-by: yamacir-kit --- README.md | 6 ++-- VERSION | 2 +- include/meevax/memory/integer_set.hpp | 40 +++++++++++++-------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 499f00bf3..a5b27d0f2 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.259_amd64.deb +sudo apt install build/meevax_0.5.260_amd64.deb ``` or @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.259.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.260.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.259_amd64.deb` +| `package` | Generate debian package `meevax_0.5.260_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 742b1a139..8d9e3ae92 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.259 +0.5.260 diff --git a/include/meevax/memory/integer_set.hpp b/include/meevax/memory/integer_set.hpp index 592779b0f..38711bf2a 100644 --- a/include/meevax/memory/integer_set.hpp +++ b/include/meevax/memory/integer_set.hpp @@ -167,24 +167,24 @@ inline namespace memory return *this; } - auto operator *() const noexcept -> T + constexpr auto operator *() const noexcept -> T { assert(good()); return reinterpret_cast((i << (Es + ...) bitor *iter) << compressible_bitwidth_of); } - auto good() const noexcept -> bool + constexpr auto good() const noexcept -> bool { assert(data); return i < N; } - auto at_end() const noexcept -> bool + constexpr auto at_end() const noexcept -> bool { return not data or not good() or iter.at_end(); } - auto is_same_index(const_iterator const& other) const noexcept -> bool + constexpr auto is_same_index(const_iterator const& other) const noexcept -> bool { return i == other.i and iter.is_same_index(other.iter); } @@ -241,7 +241,7 @@ inline namespace memory { return std::apply([this](auto&&... xs) { - return insert(std::forward(xs)...); + return this->insert(std::forward(xs)...); }, split(reinterpret_cast(value))); } @@ -257,22 +257,22 @@ inline namespace memory { return std::apply([this](auto&&... xs) { - return erase(std::forward(xs)...); + return this->erase(std::forward(xs)...); }, split(reinterpret_cast(value))); } template - auto contains(std::size_t i, Ts&&... xs) const noexcept + constexpr auto contains(std::size_t i, Ts&&... xs) const noexcept { return data[i] and data[i]->contains(std::forward(xs)...); } - auto contains(T value) const noexcept -> bool + constexpr auto contains(T value) const noexcept -> bool { return std::apply([this](auto&&... xs) { - return contains(std::forward(xs)...); + return this->contains(std::forward(xs)...); }, split(reinterpret_cast(value))); } @@ -297,7 +297,7 @@ inline namespace memory { return std::apply([this](auto&&... xs) { - return lower_bound(std::forward(xs)...); + return this->lower_bound(std::forward(xs)...); }, split(reinterpret_cast(value))); } @@ -420,24 +420,24 @@ inline namespace memory return *this; } - auto operator *() const noexcept + constexpr auto operator *() const noexcept { assert(good()); return reinterpret_cast(index); } - auto good() const noexcept -> bool + constexpr auto good() const noexcept -> bool { assert(data); return index < N; } - auto at_end() const noexcept -> bool + constexpr auto at_end() const noexcept -> bool { return not data or not good(); } - auto is_same_index(const_iterator const& other) const noexcept -> bool + constexpr auto is_same_index(const_iterator const& other) const noexcept -> bool { return index == other.index; } @@ -455,22 +455,22 @@ inline namespace memory auto insert(T value) noexcept { - auto i = reinterpret_cast(value) / 64; - auto j = reinterpret_cast(value) % 64; + auto i = static_cast(value) >> 6; + auto j = static_cast(value) & 0b111111; data[i] |= (1_u64 << j); } auto erase(T value) noexcept { - auto i = reinterpret_cast(value) / 64; - auto j = reinterpret_cast(value) % 64; + auto i = static_cast(value) >> 6; + auto j = static_cast(value) & 0b111111; data[i] &= ~(1_u64 << j); } auto contains(T value) noexcept -> bool { - auto i = reinterpret_cast(value) / 64; - auto j = reinterpret_cast(value) % 64; + auto i = static_cast(value) >> 6; + auto j = static_cast(value) & 0b111111; return data[i] & (1_u64 << j); }