* Gonçalo Rodrigues:
Is it possible to call a constructor of a class, call it Object,
explicitely?
Yes, but that is _not_ what you then clarify you're asking for.
e.g. suppose you have a void pointer ptr pointing to a
block of memory big-enough to hold an Object. Is there a way to
initialize the region pointed to by ptr by somehow calling one of
Object's constructors?
Yes, there are two ways.
If you're not picky about having that pointer in the first place, but
any region of memory is okay, then you can use std::vector's "safe"
functionality for this, namely the default value argument which invokes
your object's copy constructor.
If you absolutely insist on construction in *ptr then you can
include <new>, I think it was, and then write
::new(ptr) Object;
which in common-speak is called "placement new".
If it's not possible or a "don't do that" it's no big deal.
It's a "don't do that".
There are numerous pitfalls.
Even experts get it wrong.
It is more
of a curiosity question -- it would make a piece of my code simpler --
than an actual specific need.
Describe your problem and/or post your code; it's very likely that there
is at least one coding or design level solution that's infinitely better!