Re: a little syntax goes a long way??
From: jeffc (nobody_at_nowhere.com)
Date: 06/01/04
- Next message: Victor Bazarov: "Re: Simulatneous declare/initialize member variable"
- Previous message: Nomak: "Re: C++ api representation ?"
- In reply to: cppaddict: "a little syntax goes a long way??"
- Next in thread: Andrey Tarasevich: "Re: a little syntax goes a long way??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 1 Jun 2004 10:09:59 -0400
"cppaddict" <hello@hello.com> wrote in message
news:leknb09j38co8bed7f4emdes33ad6kqq9m@4ax.com...
> It struck me as odd today that while class definitions require a
> semi-colon at the end, function definitions do not. I was curious if
> this small syntactic difference represents a larger conceptual
> difference between these two language constructs.
I think the "conceptual difference" lies in the meaning of "definition".
Classes are kind of funny when it comes to the meaning of "definition".
When you declare a function, you use a semicolon at the end. When you
define a function, you don't. But the "definition" of a function is really
an "implementation". Note that when you actually implement the class, you
need no semicolon. So a class "definition" is really more of a
"declaration", hence the need for the semicolon.
- Next message: Victor Bazarov: "Re: Simulatneous declare/initialize member variable"
- Previous message: Nomak: "Re: C++ api representation ?"
- In reply to: cppaddict: "a little syntax goes a long way??"
- Next in thread: Andrey Tarasevich: "Re: a little syntax goes a long way??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|