Using base class constructor

Started by
1 comment, last by WitchLord 2 months, 1 week ago

Hello there!

One more question about constructors:

class Base
{
    Base() { }

    Base(int a) {  }
}

class Derived : Base
{

}

Derived d(1);

Compiling this code gives errors:

No matching signatures to ‘Derived(const int)’
Candidates are: Derived@ Derived().

Is it true that Angelscript doesn't automatically generate constructors with arguments in derived class?

Thanks for answer in advance.

Let the power of C++ be with you.

Advertisement

No, except for the default constructor (and default copy constructor in upcoming version 2.37.0) AngelScript will not automatically generate constructors with arguments for any classes.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement