cplusplus / cplusplus/draft

[flat.map.capacity]: Where are the other `flat_meow`'s correspondences about this?

Open
#6,641 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

Only flat_map has an additional [flat.map.capacity] to specify the implementation of size/max_size member:

size_type size() const noexcept;
-1- Returns: c.keys.size().

size_type max_size() const noexcept;
-2- Returns: min<size_type>(c.keys.max_size(), c.values.max_size()).

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-noexcept empty/size of the stack/queue).

Not quite sure what I'm missing with the above.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the [flat.map.capacity] wording for flat_map with the corresponding flat_multimap, flat_set, and flat_multiset sections, then review their empty, size, max_size, and clear declarations. Check the cited stack/queue declarations and the Lakos Rule discussion for the noexcept rationale. Done means the inconsistency and noexcept behavior are explained and any needed draft wording is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.