P1673: Consider removing Mandates on T for algorithms taking `T init` parameter

Open
#356 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Start by reviewing the Mandates shown for vector_sum_of_squares after PR #354 and the requirements in [linalg.reqs.val]. Compare those constraints with the algorithms that take a T init parameter and determine whether the redundant Mandates can be removed consistently. No file or test is named; done means reaching an agreed wording change for all affected algorithms.

Written by the indexing model from the issue text.

Description

P1673 algorithms that take a T init parameter have language constraining T. For example, after applying PR #354, vector_sum_of_squares has the following Mandates.

  • [1.1]{.pnum} T meets both the Cpp17MoveConstructible
    and Cpp17LessThanComparable requirements, and

  • [1.2]{.pnum} abs(declval<InVec::value_type>()) is convertible to T.

However, [linalg.reqs.val] already has wording meant to constrain both T and algorithms that use abs. For example, T is a linear algebra value type, so it's already semiregular. This suggests that we could get rid of all these Mandates.

Dominant language
HTML
Stars
29
Forks
26
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from ORNL/cpp-proposals-pub

All issues in ORNL/cpp-proposals-pub

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.