Hi there,
The title is a bit vague, but this is the issue:
1. I have a class DerivedClass that derives from BaseClass
2. Both classes have a custom constructor
3. I have class members in DerivedClass that I want to initialize when declaring.
4. I call the constructor of BaseClass from the constructor of DerivedClass.
5. This gives me an error: Error 1 error C2612: trailing ':' illegal in base/member initializer list
This is the code in Code Editor:
Code:
private:
int _classMember = -1;
public:
DerivedClass(Object* object) : BaseClass(object)
{ }
This is what it turns into in c++ code:
Code:
private:
int _classMember;
public:
DerivedClass(Object object) : BaseClass(object) : _classMember(-1)
{ }
That should be a ",", of course. I know I can just initialize the variables myself in the constructor initialization list, but I find the Esenthel way of working more convenient.
It would be nice if it worked.
(If I add just 1 class member to the constructor init list, everything works fine, and I can initialize all class members when declaring)
Thanks!