You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
boost::container::set's iterator is a mutable iterator. This allows modification of keys, which can destroy the container's invariants, for example when using the erase-remove idiom.
This used to be a defect in std::set as well but has been fixed.
As can be seen in cppreference
// _GLIBCXX_RESOLVE_LIB_DEFECTS// DR 103. set::iterator is required to be modifiable,// but this allows modification of keys.typedeftypename _Rep_type::const_iterator iterator;
typedeftypename _Rep_type::const_iterator const_iterator;
The text was updated successfully, but these errors were encountered:
alexkaratarakis
changed the title
set::iterator should be constant
set::iterator should be constant
Jan 13, 2021
boost::container::set
'siterator
is a mutable iterator. This allows modification of keys, which can destroy the container's invariants, for example when using the erase-remove idiom.This used to be a defect in
std::set
as well but has been fixed.As can be seen in cppreference
and in stdlib:
The text was updated successfully, but these errors were encountered: