diff --git a/README.md b/README.md index 15a307a18..0422669f4 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.257_amd64.deb +sudo apt install build/meevax_0.5.258_amd64.deb ``` or @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.257.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.258.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.257_amd64.deb` +| `package` | Generate debian package `meevax_0.5.258_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 5138cc438..2b772e508 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.257 +0.5.258 diff --git a/include/meevax/memory/collector.hpp b/include/meevax/memory/collector.hpp index 45c8df39f..45358e23a 100644 --- a/include/meevax/memory/collector.hpp +++ b/include/meevax/memory/collector.hpp @@ -409,7 +409,7 @@ inline namespace memory 0x0000'0000'0000'0000 ~ 0x7FFF'FFFF'FFFF'FFFF */ template - using pointer_set = integer_set; + using pointer_set = integer_set; private: static inline pointer_set objects {}; diff --git a/include/meevax/memory/integer_set.hpp b/include/meevax/memory/integer_set.hpp index 3199dbd4f..592779b0f 100644 --- a/include/meevax/memory/integer_set.hpp +++ b/include/meevax/memory/integer_set.hpp @@ -75,23 +75,14 @@ inline namespace memory constexpr const_iterator() = default; - explicit const_iterator(integer_set const* container, std::size_t i) noexcept - : data { container->data } - , max { container->max } - , i { i } - { - assert(i <= N); - increment_unless_truthy(); - } - template - explicit const_iterator(integer_set const* container, std::size_t i, std::size_t j, Ts&&... xs) noexcept + explicit const_iterator(integer_set const* container, std::size_t i, Ts&&... xs) noexcept : data { container->data } , max { container->max } , i { i } { assert(i <= N); - increment_unless_truthy(j, std::forward(xs)...); + increment_unless_truthy(std::forward(xs)...); } explicit const_iterator(integer_set const* container) noexcept @@ -103,35 +94,35 @@ inline namespace memory assert(iter.data); } - auto increment_unless_truthy() noexcept -> void + template + auto increment_unless_truthy(Ts&&... xs) noexcept -> void { assert(data); - if (good()) + if constexpr (0 < sizeof...(Ts)) { - for (; i <= max; ++i) + if (not good() or not data[i] or not (iter = data[i]->lower_bound(std::forward(xs)...)).good()) { - if (data[i] and (iter = data[i]->lower_bound(0)).good()) - { - return; - } + ++i; + increment_unless_truthy(); } - - i = N; } + else + { + if (good()) + { + for (; i <= max; ++i) + { + if (data[i] and (iter = data[i]->lower_bound(0)).good()) + { + return; + } + } - iter = {}; - } - - template - auto increment_unless_truthy(std::size_t j, Ts&&... xs) noexcept -> void - { - assert(data); + i = N; + } - if (not good() or not data[i] or not (iter = data[i]->lower_bound(j, std::forward(xs)...)).good()) - { - ++i; - increment_unless_truthy(); + iter = {}; } }