Not legitimately, and conceptually, no, an object is created when
a constructor is called over the memory area for the a object.
An exception is the POD types, plain old data C types, structs,
which can still be created with a call to 'malloc' [then released with
free]. There's no constructor there, but then, those aren't usually
considered objects.
In a context where the constructors are private, you can't instantiate
a new copy of the object with the ''new'' operator or create an object
as a stack variable:
this can actually be very advantageous if youi want to use a pool of
shared
copies of an object, instead of creating new ones...
i.e.
class Foo {
private: Foo() {}
public: class Foo* getInstance() {
static class Foo* globalInstance = NULL;
if (globalInstance == NULL)
globalInstance = new Foo();
/* if (globalInstance == NULL)
handle error */
return globalInstance;
}
};
See, now you have to follow some internally rules defined in the
class just to get a legitimate copy of the object
-Mysid