Skip to content

P2255 A type trait to detect reference binding to temporary #949

Closed
cplusplus/draft
#5283
@wg21bot

Description

@wg21bot
Collaborator

P2255R0 A type trait to detect reference binding to temporary (Tim Song)

Activity

added this to the 2020-telecon milestone on Nov 23, 2020
added
scheduled-for-library-evolutionThis paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review
on Feb 22, 2021
wg21bot

wg21bot commented on Apr 25, 2021

@wg21bot
CollaboratorAuthor

P2255R1 A type trait to detect reference binding to temporary (Tim Song)

jfbastien

jfbastien commented on May 12, 2021

@jfbastien
Collaborator

EWG saw the paper in today's telecon.

Send P2255r1 to LEWG, with a recommendation to send it to Electronic Polling with the currently specified semantics. Only do so if LEWG agrees that the type traits as specified are useful and usable for pair, tuple, and function.

SF F N A SA
3 9 0 0 0
inbal2l

inbal2l commented on May 20, 2021

@inbal2l
Member

A short summary of the comments from LEWG's Mailing list:

  • std::tuple<const std::string&> x("hello"); is ill-formed, but the usage f(tuple<const string&>("hello")) seems desirable
    Author: I lean toward defining the ctor as deleted, so that the example is still rejected. tuple<const string&>("hello"s) (or the equivalent std::string("hello")) remains available.
  • Worried about false positives the trait may produce.
    Author: It produces an inevitably-dangling reference with tuple as specified today. Whether we go on to produce a likely-dangling reference or just reject the code outright seems like a somewhat separate decision to me; either way, it doesn't affect any existing valid C++20 code.

R1 is ready for LEWG Telecon.

added and removed
scheduled-for-library-evolutionThis paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review
on May 23, 2021

30 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++23Targeted at C++23ISShip vehicle: ISLWGLibraryexpedited-library-evolution-electronic-pollPapers that were reviewed on the mailing list and then advanced directly to electronic polling.plenary-approvedPapers approved for inclusion in their target vehicle by plenary vote.size - smallpaper size estimate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @jfbastien@brycelelbach@cor3ntin@JeffGarland@inbal2l

      Issue actions

        P2255 A type trait to detect reference binding to temporary · Issue #949 · cplusplus/papers