C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 23 May 2024 12:50:47 -0300
On Thursday 23 May 2024 12:36:26 GMT-3 Frederick Virchanza Gotham via Std-
Proposals wrote:
> So if we were to change C++26 in order to allow the following function:
>
> int Func(void)[3]
> {
> int arr[] = {1,2,3}
> return arr;
> }

Returning of C arrays should be a change to the C language, not C++.

std::array can be returned, so the C++ problem is solved. I fail to see why we
should allow a new syntax for C-style arrays when code being updated to use it
could just as easily use std::array.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Fleet Engineering and Quality

Received on 2024-05-23 15:50:53