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
However, flat_multimap, flat_set, and flat_multiset have no corresponding sections. Where does this inconsistency come from?
In addition, since all flat_meows are adaptors containing the underlying container, I can't understand why their empty/size/max_size/clear are all noexcept. According to the Lakos Rule, they should not be declared noexcept because the implementation should be by calling the member functions of the underlying container, and these functions are not guaranteed to be noexcept.
(I believe the standard seems to pay great attention to complying with the Lakos Rule, this is also reflected in the non-noexceptempty/size of the stack/queue).
Not quite sure what I'm missing with the above.
The text was updated successfully, but these errors were encountered:
In addition, since all flat_meows are adaptors containing the underlying container, I can't understand why their empty/size/max_size/clear are all noexcept. According to the Lakos Rule, they should not be declared noexcept because the implementation should be by calling the member functions of the underlying container, and these functions are not guaranteed to be noexcept.
(I believe the standard seems to pay great attention to complying with the Lakos Rule, this is also reflected in the non-noexceptempty/size of the stack/queue).
This may be an oversight.
N3187 said that empty should be noexcept because "it depends on iterator comparison which cannot throw for library provided iterators". However, the iterator comparison may eventually involve user-provided fancy pointers (see also LWG2261), of which comparison is not required to be noexcept, but merely not to throw when the comparison is well-defined.
Similarly, do we need to make exception specifications for move constructors of containers more conditional, just because copy/move construction of fancy pointers are not required to be noexcept?
Given there're already some noexcept functions that don't (or even can't) always avoid calling non-noexcept underlying operations, I think empty and size of all container adaptors should be noexcept. Let's submit an LWG issue for this.
Only flat_map has an additional [flat.map.capacity] to specify the implementation of
size
/max_size
member:However,
flat_multimap
,flat_set
, andflat_multiset
have no corresponding sections. Where does this inconsistency come from?In addition, since all
flat_meow
s are adaptors containing the underlying container, I can't understand why theirempty
/size
/max_size
/clear
are allnoexcept
. According to the Lakos Rule, they should not be declarednoexcept
because the implementation should be by calling the member functions of the underlying container, and these functions are not guaranteed to benoexcept
.(I believe the standard seems to pay great attention to complying with the Lakos Rule, this is also reflected in the non-
noexcept
empty
/size
of thestack
/queue
).Not quite sure what I'm missing with the above.
The text was updated successfully, but these errors were encountered: