cplusplus / cplusplus/draft

[optional.monadic] Should we remove invented variable declarations?

Open
#6,256 0 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

[optional.monadic]/8 currently states:

Mandates: U is a non-array object type other than in_place_t or nullopt_t. The declaration
U u(invoke(std::forward<F>(f), value()));
is well-formed for some invented variable u.

In this declartion, invoke(std::forward<F>(f), value()) is a prvalue of cv U since U is remove_cv_t<invoke_result_t<F>>, so the declaration would be well-formed as long as U is well-formed.

Should we just say U is well-formed instead, or don't explicitly say any additional requirement given it is implicitly required that U is well-formed?

expected::transform and expected::transform_error have the same 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

Read the wording in [optional.monadic]/8 and compare the corresponding requirements in expected::transform and expected::transform_error. Determine whether the invented-variable declarations add a necessary constraint, then confirm the preferred consistent wording for all three clauses; done means the issue's wording question is resolved and the draft text is updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
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.