base::size fails for empty arrays. |
||
Issue descriptionbase::size() does not compile when array size is zero.
,
Aug 1
I'm assuming you are talking about C arrays, as it's working fine for empty std::arrays. Here the compilation failure is actually working as intended, as zero-length arrays are not allowed by the standard [1]: """ [...] If the constant-expression is present, it shall be a converted constant expression of type std::size_t and its value shall be greater than zero. [...] """ A small reproduction case is here: https://godbolt.org/g/wTsb7R. Because of this, I am marking this as WontFix. Would it be possible for you to use an empty std::array to work around this? [1] http://eel.is/c++draft/dcl.array#1 |
||
►
Sign in to add a comment |
||
Comment 1 by gab@chromium.org
, Aug 1Status: Assigned (was: Untriaged)