C++ Logo


Advanced search

Subject: Re: [std-proposals] [External] std::to_array support for zero-length arrays
From: D'Alessandro, Luke K (ldalessa_at_[hidden])
Date: 2020-11-04 18:21:40

Hi Zhihao

On Nov 4, 2020, at 7:51 AM, Zhihao Yuan <zy_at_[hidden]<mailto:zy_at_[hidden]>> wrote:

On Wednesday, November 4, 2020 12:23 AM, D'Alessandro, Luke K <ldalessa_at_[hidden]<mailto:ldalessa_at_[hidden]>> wrote:

I think I'll probably put the tag class into [array.creation] and suggest changing its title from "Array creation functions" to "Array creation." The alternative would be another section somewhere...?

I did consider this, but it didn't bother me. It wasn't clear if this is actually something that [array.creation] is trying to avoid. I am concerned about the variance in sizeof(std::array<int, 0>) that I can already observe in current implementations, so it's a moot point.

Putting my comments together you may find
that I'm suggesting an exposition-only tag
type. So that you don't need to change
the section title, and I don't need to worry
about the mandatory loss of defensiveness.

Do you have an example of somewhere else in the standard that defines such an "exposition-only type" that I could use for reference language? (I presume that this means that the actual type name is implementation-defined, though the definition must be equivalent to "struct zero_length_array_tag{};").

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

Luke D'Alessandro, Ph.D.
Department of Intelligent Systems Engineering
Indiana University Bloomington

STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups