Ugrás a tartalomhoz

virtual constructor

A Wikiszótárból, a nyitott szótárból


Főnév

virtual constructor (tsz. virtual constructors)

  1. (informatika) In C++, we CANNOT make a constructor virtual. The reason is that C++ is a statically typed language, so the concept of a virtual constructor is a contradiction because the compiler needs to know the exact type at compile time to allocate the correct amount of memory and initialize the object correctly.