Skip to content

Commit

Permalink
Merge pull request #246 from OpenVicProject/fix/self-friend-warning
Browse files Browse the repository at this point in the history
Fix base_iterator_t friend of itself warning
  • Loading branch information
Hop311 authored Dec 14, 2024
2 parents 21d0aff + 1e838c4 commit ea99f0c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/openvic-simulation/types/IndexedMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ namespace OpenVic {

template<bool CONST>
struct base_iterator_t {
friend struct base_iterator_t;

using map_type = IndexedMap<Key, Value>;

using key_type = map_type::key_type;
Expand Down Expand Up @@ -169,37 +167,37 @@ namespace OpenVic {

template<bool OTHER_CONST>
difference_type operator-(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it - rhs.key_it;
return key_it - rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator==(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it == rhs.key_it;
return key_it == rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator!=(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it != rhs.key_it;
return key_it != rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator<(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it < rhs.key_it;
return key_it < rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator>(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it > rhs.key_it;
return key_it > rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator<=(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it <= rhs.key_it;
return key_it <= rhs.get_key_it();
}

template<bool OTHER_CONST>
bool operator>=(base_iterator_t<OTHER_CONST> const& rhs) const {
return key_it >= rhs.key_it;
return key_it >= rhs.get_key_it();
}
};

Expand Down

0 comments on commit ea99f0c

Please sign in to comment.