Skip to content

Commit

Permalink
Allow to use BitInputArchive's ConstIterator in const variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Mar 13, 2024
1 parent e79d76b commit a88e99e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/bit7z/bitinputarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@ class BitInputArchive {
*
* @return a reference to the pointed-to element in the archive.
*/
auto operator*() noexcept -> reference;
auto operator*() const noexcept -> reference;

/**
* @brief Accesses the pointed-to element in the archive.
*
* @return a pointer to the pointed-to element in the archive.
*/
auto operator->() noexcept -> pointer;
auto operator->() const noexcept -> pointer;

private:
BitArchiveItemOffset mItemOffset;
Expand Down
4 changes: 2 additions & 2 deletions src/bitinputarchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,11 @@ BitInputArchive::ConstIterator::operator!=( const BitInputArchive::ConstIterator
return !( *this == other );
}

auto BitInputArchive::ConstIterator::operator*() noexcept -> BitInputArchive::ConstIterator::reference {
auto BitInputArchive::ConstIterator::operator*() const noexcept -> BitInputArchive::ConstIterator::reference {
return mItemOffset;
}

auto BitInputArchive::ConstIterator::operator->() noexcept -> BitInputArchive::ConstIterator::pointer {
auto BitInputArchive::ConstIterator::operator->() const noexcept -> BitInputArchive::ConstIterator::pointer {
return &mItemOffset;
}

Expand Down

0 comments on commit a88e99e

Please sign in to comment.