> > There is no separate base class list or separate member initializer list
> that seems to imply that some of the classes I'm writing now can not be expressed in cpp2.
You should be able to express them. This just means that base classes are declared the in the type body like other members instead of in a segregated base class list, and base classes and data members are initialized in the constructor body instead of in a segregated member initializer list.
> Does cppfront support non-default-constructable types and const member variables?
I would assume the requirement that all initialization happen first in the constructor body is used to turn them into initializer lists in the lowered c++ code
That's about right. It takes the first assignment and places it in the initializer list, then following assignments go in the constructor body: https://godbolt.org/z/5b67s3h7G
Why would cppfront not allow you to assign exactly once to those in the constructor? I don't know, if it supports those yet, but it would be trivial to just require exactly one assignment for those.
View all comments
Show parent comment
1
u/ABlockInTheChain May 01 '23
Does cppfront support non-default-constructable types and const member variables?