Skip to content

Commit

Permalink
removed const
Browse files Browse the repository at this point in the history
  • Loading branch information
fnc12 committed Oct 10, 2023
1 parent 6ef07f8 commit e8fcb85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dev/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ namespace sqlite_orm {
next();
}

const value_type& operator*() const {
value_type& operator*() const {
if(!this->stmt || !this->current) {
throw std::system_error{orm_error_code::trying_to_dereference_null_iterator};
}
return *this->current;
}

const value_type* operator->() const {
value_type* operator->() const {
return &(this->operator*());
}

Expand Down
4 changes: 2 additions & 2 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11229,14 +11229,14 @@ namespace sqlite_orm {
next();
}

const value_type& operator*() const {
value_type& operator*() const {
if(!this->stmt || !this->current) {
throw std::system_error{orm_error_code::trying_to_dereference_null_iterator};
}
return *this->current;
}

const value_type* operator->() const {
value_type* operator->() const {
return &(this->operator*());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/static_tests/iterator_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST_CASE("iterator_t") {
using check = decltype(std::declval<iter>()++);

// indirectly_readable
STATIC_REQUIRE(std::is_same<decltype(*std::declval<const iter>()), const User&>::value);
STATIC_REQUIRE(std::is_same<decltype(*std::declval<const iter>()), User&>::value);

// input_iterator
STATIC_REQUIRE(std::is_same<iter::iterator_category, std::input_iterator_tag>::value);
Expand Down

0 comments on commit e8fcb85

Please sign in to comment.