Date
2017-05-13.10:02:14
Message id
8632

Content

Addresses: fund.ts.v2

C++ doesn't have a prvalue expression of array type, but rvalue arrays can still come from different kinds of sources:

  1. C99 compound literals (int[]) {2, 4},

  2. std::move(arr),

  3. Deduction to_array<int const>({ 2, 4 }).

    See also CWG 1591: Deducing array bound and element type from initializer list.

For 3), users are "abusing" to_array to get access to uniform initialization to benefit from initializing elements through braced-init-list and/or better narrowing conversion support.

We should just add rvalue reference support to to_array.