C++ Logo

std-proposals

Advanced search

Re: [std-proposals] C-style array specialization for std::get

From: Zhihao Yuan <zy_at_[hidden]>
Date: Tue, 01 Mar 2022 18:10:25 +0000
On Tuesday, March 1st, 2022 at 9:40 AM, Arthur O'Dwyer via Std-Proposals <std-proposals_at_[hidden]> wrote:

> Nope; if you're supporting `std::get` for C arrays, the only reason I can imagine for doing so is because you want to supportint arr[3] = {1,2,3};int [a,b,c] = arr;and for that to work, you're going to need tuple_size and tuple_element.

I wouldn't say you don't want tuple_sizeand tuple_element, but they do nothingto structured binding. Structured bindingshave dedicated rules for C arrays[dcl.struct.bind] (eel.is) and it kicks inearly, ignoring all tuple_* stuff.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

Received on 2022-03-01 18:10:28