Skip to content

[flat.map.defn] [flat.multimap.defn] Exposition-only markup for "c" and "compare" #5914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14702,15 +14702,15 @@
const mapped_container_type& mapped_cont, const Allocator& a);

explicit flat_map(const key_compare& comp)
: c(), compare(comp) { }
: \exposid{c}(), \exposid{compare}(comp) { }
template<class Allocator>
flat_map(const key_compare& comp, const Allocator& a);
template<class Allocator>
explicit flat_map(const Allocator& a);

template<class InputIterator>
flat_map(InputIterator first, InputIterator last, const key_compare& comp = key_compare())
: c(), compare(comp) { insert(first, last); }
: \exposid{c}(), \exposid{compare}(comp) { insert(first, last); }
template<class InputIterator, class Allocator>
flat_map(InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
Expand All @@ -14731,7 +14731,7 @@
template<class InputIterator>
flat_map(sorted_unique_t s, InputIterator first, InputIterator last,
const key_compare& comp = key_compare())
: c(), compare(comp) { insert(s, first, last); }
: \exposid{c}(), \exposid{compare}(comp) { insert(s, first, last); }
template<class InputIterator, class Allocator>
flat_map(sorted_unique_t, InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
Expand Down Expand Up @@ -14895,8 +14895,8 @@
{ x.swap(y); }

private:
containers c; // \expos
key_compare compare; // \expos
containers \exposid{c}; // \expos
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was one thing I wasn't sure how to do markup-wise, so I left it alone / out-of-scope: Line 14978 has

Initializes \tcode{c.keys} with \tcode{std::move(key_cont)}

where ideally the c should be expos-only but the keys shouldn't.

Copy link
Contributor

@JohelEGP JohelEGP Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I meant with #5914 (comment). By convention, marking with \exposid in the class synopsis is not enough. All uses of those members throughout are marked with \exposid.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just use

Initializes \tcode{\exposid{c}.keys} with \tcode{std::move(key_cont)}

key_compare \exposid{compare}; // \expos

struct key_equiv { // \expos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think key_equiv should also be formatted with \exposid{}. Perhaps its comp member should also be considered exposition only, although not strictly needed due to priority_queue's comp.

(How about changing to kebab-case and/or eliminating its ctor as aggregate initialization can do the right thing?)

key_equiv(key_compare c) : comp(c) { }
Expand Down Expand Up @@ -15843,7 +15843,7 @@
const mapped_container_type& mapped_cont, const Allocator& a);

explicit flat_multimap(const key_compare& comp)
: c(), compare(comp) { }
: \exposid{c}(), \exposid{compare}(comp) { }
template<class Allocator>
flat_multimap(const key_compare& comp, const Allocator& a);
template<class Allocator>
Expand All @@ -15852,7 +15852,7 @@
template<class InputIterator>
flat_multimap(InputIterator first, InputIterator last,
const key_compare& comp = key_compare())
: c(), compare(comp)
: \exposid{c}(), \exposid{compare}(comp)
{ insert(first, last); }
template<class InputIterator, class Allocator>
flat_multimap(InputIterator first, InputIterator last,
Expand All @@ -15874,7 +15874,7 @@
template<class InputIterator>
flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last,
const key_compare& comp = key_compare())
: c(), compare(comp) { insert(s, first, last); }
: \exposid{c}(), \exposid{compare}(comp) { insert(s, first, last); }
template<class InputIterator, class Allocator>
flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last,
const key_compare& comp, const Allocator& a);
Expand Down Expand Up @@ -16008,8 +16008,8 @@
{ x.swap(y); }

private:
containers c; // \expos
key_compare compare; // \expos
containers \exposid{c}; // \expos
key_compare \exposid{compare}; // \expos
};

template<class KeyContainer, class MappedContainer>
Expand Down