I would think so but there is no reason for it. Virtual is used in inheritance. You can call the parent constructor upon creation. If you need access to private members of the parent then they should not be private but protected. Also, the child class would need to redefine the parent constructor.
No, constructors can't be virtual. If you require functionality analogous to virtual constructors, look up the Abstract Factory, Builder, or Factory Method design patterns and see if they provide a solution.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.