* Jim Langston:
I read the OP's question as: I do not know if C++ would allow a virtual
constructor, but if it did, what would be it's purpose? What would making a
constructor virtual accomplish?
Don't inform me. Instead, bring your interpretation with your response,
if it has any bearing on the response. Anyway, I think it's a Good Idea
to assume a question is meaningful, like the established meaning for the
actual words used by the OP, rather than something meaningless.
Which is why the two part answer. C++ directly does not support a virtual
constructor. Which is an answer of No. But, you could do what a virtual
constructor would supposedly do by using a virtual clone() or create()
member function which is what people think a virtual constructor would do if
C++ in fact supported it.
Also here. There are several possible meanings for "virtual
constructor" apart from the established meaning, most notably the one of
doing virtual construction (where part of the construction is specified
by a derived class; directly supported in Java and C# by breaking those
languages' type safety, and possible to simulate in C++, see the FAQ).
But yours isn't one: a constructor can't do the job of a clone function.
As far as learning experience in searching in the FAQ, I'm sure that 95% of
the questions asked in this newsgroup could be answered by STFW, if not 100%
of them.
Does that mean "Searching The Fucking Web"? Language, Jim. Also,
that's highly misleading: nobody tried to send anyone on a wild-goose
chase, as you imply, but instead the OP was directed on a highly focused
search guaranteed to yield a useful result.
But you then stepped in with a totally unncessary "clear up things"
posting which in addition to depriving the OP the chance to learn to
something, was factually incorrect, and as you now clarify, relied on a
meaningless interpretation of the question rather than assuming some
meaning in there.