STL icon indicating copy to clipboard operation
STL copied to clipboard

When will P2128 be implemented?

Open dr-eck opened this issue 3 years ago • 2 comments

I'd really like to be able to write the following code:

std::vector<double> Bdat(dfcts.ndf * vbs.nvb);     // allocate the space
    using Dext = std::dextents<size_t, 2>;
    std::mdspan<double, Dext> B{ Bdat.data(), dfcts.ndf, vbs.nvb};    // create the mdspan
    B[0, 0] = 1.0;

But, according to 康桓瑋 on StackOverflow, the last line needs to be:

B[std::array{0, 0}] = 1.0;

That's really ugly! When will P2128R6 be implemented?

dr-eck avatar Nov 15 '23 17:11 dr-eck

It will, but perhaps not soon. Nothing can be furtherly done in a standard library implementation, but you can use Clang-CL in the meanwhile.

The implementation of P2128R6 by MSVC is tracked in DevCom-10306063.

frederick-vs-ja avatar Nov 15 '23 17:11 frederick-vs-ja

We can't speculate on when a compiler feature will be implemented, so all we can really do is guarantee that it will be implemented before we consider C++23 to be complete.

CaseyCarter avatar Nov 15 '23 17:11 CaseyCarter