Skip to content

Commit

Permalink
Lipsticks
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Nov 3, 2024
1 parent 256b79a commit 54b5ac6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.259
0.5.260
40 changes: 20 additions & 20 deletions include/meevax/memory/integer_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>((i << (Es + ...) bitor *iter) << compressible_bitwidth_of<T>);
}

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);
}
Expand Down Expand Up @@ -241,7 +241,7 @@ inline namespace memory
{
return std::apply([this](auto&&... xs)
{
return insert(std::forward<decltype(xs)>(xs)...);
return this->insert(std::forward<decltype(xs)>(xs)...);
},
split<E, Es...>(reinterpret_cast<std::uintptr_t>(value)));
}
Expand All @@ -257,22 +257,22 @@ inline namespace memory
{
return std::apply([this](auto&&... xs)
{
return erase(std::forward<decltype(xs)>(xs)...);
return this->erase(std::forward<decltype(xs)>(xs)...);
},
split<E, Es...>(reinterpret_cast<std::uintptr_t>(value)));
}

template <typename... Ts>
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<decltype(xs)>(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<decltype(xs)>(xs)...);
return this->contains(std::forward<decltype(xs)>(xs)...);
},
split<E, Es...>(reinterpret_cast<std::uintptr_t>(value)));
}
Expand All @@ -297,7 +297,7 @@ inline namespace memory
{
return std::apply([this](auto&&... xs)
{
return lower_bound(std::forward<decltype(xs)>(xs)...);
return this->lower_bound(std::forward<decltype(xs)>(xs)...);
},
split<E, Es...>(reinterpret_cast<std::uintptr_t>(value)));
}
Expand Down Expand Up @@ -420,24 +420,24 @@ inline namespace memory
return *this;
}

auto operator *() const noexcept
constexpr auto operator *() const noexcept
{
assert(good());
return reinterpret_cast<T>(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;
}
Expand All @@ -455,22 +455,22 @@ inline namespace memory

auto insert(T value) noexcept
{
auto i = reinterpret_cast<std::size_t>(value) / 64;
auto j = reinterpret_cast<std::size_t>(value) % 64;
auto i = static_cast<std::size_t>(value) >> 6;
auto j = static_cast<std::size_t>(value) & 0b111111;
data[i] |= (1_u64 << j);
}

auto erase(T value) noexcept
{
auto i = reinterpret_cast<std::size_t>(value) / 64;
auto j = reinterpret_cast<std::size_t>(value) % 64;
auto i = static_cast<std::size_t>(value) >> 6;
auto j = static_cast<std::size_t>(value) & 0b111111;
data[i] &= ~(1_u64 << j);
}

auto contains(T value) noexcept -> bool
{
auto i = reinterpret_cast<std::size_t>(value) / 64;
auto j = reinterpret_cast<std::size_t>(value) % 64;
auto i = static_cast<std::size_t>(value) >> 6;
auto j = static_cast<std::size_t>(value) & 0b111111;
return data[i] & (1_u64 << j);
}

Expand Down

0 comments on commit 54b5ac6

Please sign in to comment.