cplusplus / cplusplus/draft

Calls to swap in the library don't properly describe context

Open
#3,798 3 comments 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

In the following sections:

  • iter_swap: [alg.swap]/7
  • pair::swap: [pairs.pair]/30
  • optional::swap: [optional.swap]/2
  • tuple::swap: [tuple.swap]/2
  • variant::swap: [variant.swap]/2
  • possibly others

We describe swapping as either doing swap(a, b) or otherwise calling swap - which in the library wording always means ::std::swap, since we don't otherwise describe what happens here. But in these contexts, what we mean is that we're calling swap in the context described in [swappable.requirements]/3 (i.e. using ::std::swap; swap(a, b)). This is done correctly in the description for is_­swappable_­with in [meta.unary.prop].

Is updating all these sections an editorial fix (this is the behavior we actually mean, just poorly specified) or does this require a library issue?

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 reading the cited sections—iter_swap, pair::swap, optional::swap, tuple::swap, and variant::swap—alongside [swappable.requirements]/3 and the is_swappable_with wording in [meta.unary.prop]. Check whether other library clauses use the same description; done means the applicable wording consistently specifies the intended swap context and the editorial-versus-library classification is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
tex
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.