Skip to content

[over.match.class.deduct] Wording does not seem to match intention CWG2681 #3898

@cpplearner

Description

@cpplearner

[over.match.class.deduct]/(1.8):

if ei is of array type and xi is a braced-init-list or string-literal, Ti is an rvalue reference to the declared type of ei

According to P2082R1, the intent is to permit

template<class T, std::size_t N>
struct A {
    T array[N];
};

A a2 = {"meow"}; // should deduce A<const char, 5>

However, since "meow" is an lvalue, and the parameter Ti is an rvalue reference, it seems that the deduction would fail, contrary to the expectation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-requiredA decision of the editorial group (or the Project Editor) is required.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions