Skip to content
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

Allow data member splices in designated initializers #27

Closed
katzdm opened this issue Apr 4, 2024 · 1 comment
Closed

Allow data member splices in designated initializers #27

katzdm opened this issue Apr 4, 2024 · 1 comment
Labels
p2996-ext A behavior not part of P2996, but proposed for a related paper

Comments

@katzdm
Copy link
Collaborator

katzdm commented Apr 4, 2024

P2996 co-authors are exploring whether splicers of data members should be allowed in designated initializers. One of the examples linked to from P2996R2 has this example, which no implementation currently implements:

constexpr Variant() requires std::is_default_constructible_v<first_type>
    : storage_{ .[: get_nth_nsdm(0) :]{} }
    , index_(0)
{
    std::construct_at(&storage_.[: get_nth_nsdm(0) :]);
}

Note that get_nth_nsdm(0) could (and likely would) be dependent on a template parameter.

@katzdm katzdm added the p2996-speculative A behavior considered for adoption in P2996, but not yet been agreed on label Apr 4, 2024
@katzdm katzdm added p2996-ext A behavior not part of P2996, but proposed for a related paper and removed p2996-speculative A behavior considered for adoption in P2996, but not yet been agreed on labels May 24, 2024
@katzdm
Copy link
Collaborator Author

katzdm commented May 24, 2024

Not planning to adopt this for P2996, and therefore will not implement for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2996-ext A behavior not part of P2996, but proposed for a related paper
Projects
None yet
Development

No branches or pull requests

1 participant