🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using base class constructor

Started by
1 comment, last by WitchLord 3 months, 2 weeks 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