On 12/09/2016 07:46 PM, Martin Sebor wrote:
On 12/09/2016 02:49 PM, Jason Merrill wrote:
On Fri, Dec 9, 2016 at 11:33 AM, Martin Sebor <mse...@gmail.com> wrote:
For flexible array members, because they're not in C++, we get to
make up the rules that make the most sense to us.  IMO, they should
fit in well with the rest of the language.

I disagree; we should support C code, but flexible arrays don't really
fit with the C++ object model, so I don't think trying to do anything
clever with them in constructors is worthwhile.

With the suggested approach the array becomes just an ordinary member.
It's not a flexible array member anymore because its bound is deduced
from the initializer (it just looks like one).  The NSDMI char a[] =
"foo" syntax is just a shorthand for char a[4] = "foo".

That would mean that the size of the class varies with its initializer, which again gets into not fitting with the C++ object model.

Jason

Reply via email to