Re: Default constructor
From: jeffc (nobody_at_nowhere.com)
Date: 09/02/04
- Next message: Christoff Pale: "Re: deleting entries in a list"
- Previous message: Thomas Matthews: "Re: Const Qualifier question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 2 Sep 2004 12:34:59 -0400
"Cy Edmunds" <cedmunds@spamless.rochester.rr.com> wrote in message
news:sTpYc.207327$bp1.7462@twister.nyroc.rr.com...
>
> 2) Automatic default constructor inserted even if the programmer provides
a
> constructor with arguments. Now the client can declare objects of this
type
> without providing the arguments, possibly leaving the object in an
undefined
> state again. The programmer can define a private default constructor but
> that seems like too much trouble for what is after all a perfectly common
> situation.
>
> In short, there seems to be no reasonable alternative.
2 is a reasonable alternative, they just chose not to do it that way. (If
the programmer thought creating an object with no initializing parameters
were bad, he could simply define a default constructor that initialized
things in a default way.) Philosophically, they just decided that when the
programmer takes over, he takes over all. No technical reason it has to be
that way.
- Next message: Christoff Pale: "Re: deleting entries in a list"
- Previous message: Thomas Matthews: "Re: Const Qualifier question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|