Skip to content

Commit

Permalink
C-style cast to fix the issues is probably bad
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Nov 9, 2023
1 parent bc75099 commit 5891b34
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tools/ranges/AnyIterator/AnyIteratorModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class AnyInputIteratorModel final :

reference operator*() const override {

return *this->iter_;
return ( reference )( *this->iter_ );
}

pointer operator->() const override {

return std::addressof( *this->iter_ );
return ( pointer )( std::addressof( *this->iter_ ) );
}

AnyInputIteratorModel& operator++() override {
Expand Down Expand Up @@ -96,12 +96,12 @@ class AnyForwardIteratorModel final :

reference operator*() const override {

return *this->iter_;
return ( reference )( *this->iter_ );
}

pointer operator->() const override {

return std::addressof( *this->iter_ );
return ( pointer )( std::addressof( *this->iter_ ) );
}

AnyForwardIteratorModel& operator++() override {
Expand Down Expand Up @@ -155,12 +155,12 @@ class AnyBidirectionalIteratorModel final :

reference operator*() const override {

return *this->iter_;
return ( reference )( *this->iter_ );
}

pointer operator->() const override {

return std::addressof( *this->iter_ );
return ( pointer )( std::addressof( *this->iter_ ) );
}

AnyBidirectionalIteratorModel& operator++() override {
Expand Down Expand Up @@ -249,12 +249,12 @@ class AnyRandomAccessIteratorModel final :

reference operator*() const override {

return *this->iter_;
return ( reference )( *this->iter_ );
}

pointer operator->() const override {

return std::addressof( *this->iter_ );
return ( pointer )( std::addressof( *this->iter_ ) );
}

AnyRandomAccessIteratorModel& operator++() override {
Expand All @@ -271,7 +271,7 @@ class AnyRandomAccessIteratorModel final :

reference operator[]( difference_type i ) const override {

return this->iter_[i];
return ( reference )( this->iter_[i] );
}

AnyRandomAccessIteratorModel& operator+=( difference_type i ) override {
Expand Down

0 comments on commit 5891b34

Please sign in to comment.