Re: A question about One Definition Rule
From: Gary (glabowitz_at_comcast.net)
Date: 11/30/03
- Next message: A: "Re: What After C and C++?"
- Previous message: arenaTR: "NEWBIE: compilation trouble!!!"
- In reply to: Jeff: "Re: A question about One Definition Rule"
- Next in thread: CoolPint: "Re: A question about One Definition Rule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Nov 2003 16:13:46 -0800
jeffplus@comcast.net (Jeff) wrote in message news:<a81f684.0311290636.2c26fbd9@posting.google.com>...
> > I just realized I might have broken the rule by defining the exception
> > classes in the header file. But my linker does NOT complain.
>
> The class definitions all have to be identical. As long as that's
> true (e.g. because they all come from the same included file), you're
> okay.
I'm glad the OP is now okay. But your answer threw me off.
Are you actually talking about a class definition, meaning the code of
the functions? Or do you mean a class declaration, which just
indicates what identifiers in the class refer to?
I have been teaching that the description of a class, giving its
contents by name, does not cause allocation of memory. I've called it
a declaration, only.
I'm aware that a declaration can also be a definiton (as in int x;
which declares x to be an int, and also allocates memory for an int
called x), but I'm under the impression that declaration of classes
does not also define unless code is contained in it. The actual
allocation of memory takes place when an object of the class type is
created.
These are such slippery terms, I'd like your input on this. Thanks.
-- Gary
- Next message: A: "Re: What After C and C++?"
- Previous message: arenaTR: "NEWBIE: compilation trouble!!!"
- In reply to: Jeff: "Re: A question about One Definition Rule"
- Next in thread: CoolPint: "Re: A question about One Definition Rule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|