A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cplusplus/nbballot/issues/519 below:

US 42-103 24.6.9.1p6 [flat.map.overview] 24.6.10.1p6 [flat.multimap.overview] Clearing when restoring invariants · Issue #519 · cplusplus/nbballot · GitHub

In 24.6.9.1p6 [flat.map.overview] states: If any member function in 24.6.9.2 exits via an exception, the invariants are restored. [Note 2: This can result in the flat_map being emptied. — end note]

It is unclear how an adaptor can do this. For instance, if one of the underlying sequence containers is a std::array like type (possibly 3rd party) and the other is a std::vector like type (possibly 3rd party) and an exception is thrown during a move assignment, how does the implementation of flat_map restore the invariants? One cannot clear an array, and attempting to resize a vector may fail.

There is an identical issue with flat_multimap.

Proposed change:

Disallow array-like types as the underlying sequence containers (with the understanding that we could add them back in a future standard should this issue be worked out).

We can then require that clear() is called when an exception is thrown and that the post condition c.empty() holds for the underlying containers.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4