C++ Logo

std-proposals

Advanced search

Re: [External] std::to_array support for zero-length arrays

From: D'Alessandro, Luke K <ldalessa_at_[hidden]>
Date: Thu, 5 Nov 2020 00:21:40 +0000
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
ldalessa_at_[hidden]<mailto:ldalessa_at_[hidden]du>


Received on 2020-11-04 18:21:44