Should the subscript "opt" be dropped in the definition of "array of N T" in the standard?

This is the definitive syntax of "array of N T" in C++ Standard https://eel.is/c++draft/dcl.array#1 :
D1 [ constant-expression_opt ] ...

I think the subscript "opt" should not be there for two reasons:

1) The descriptions of the item seem to assume that "constant-expression" cannot be omitted. If the bracket is empty, the descriptions would make no sense.

2) If "constant-expression" is omitted, the item 1 would be reduced to item 2. There is no need to take out this special case as a separate item.

Am I right?
I think you might be right. It seems like a left-over from C++17 where it used one form to describe both cases, with and without constant expression. https://timsong-cpp.github.io/cppwp/n4659/dcl.array#1
Last edited on
Thank you!
Registered users can post here. Sign in or register to post.