[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: struct <-> class
From:       Michael Matz <matz () ifh ! de>
Date:       2000-05-26 22:43:36
[Download RAW message or body]

Hi,

On Fri, 26 May 2000, Carsten Pfeiffer wrote:
> > btw, I once asked you why we use classes, while Qt uses structs for all
> > those private pointers. We're having the problem with many many symbols in
> > KDE, making the linking slow. Now with the additional class, we don't just
> > 
> > Could that be the reason why the Trolls use structs? And would it be a
> > good idea to do that, too? I'm not a compiler guru tho, so I might be way
> > off here (is the same generated for a struct as well?).

I'm not sure of reasons why trolltech uses struct. May be because they
have not to specify access specifiers, or may be because they want to
explicitly look private classes in another way for source structural
reasons, or its simply historical.

But I know, it's not because it gives fewer symbols in the final
lib. Class and struct are the same besides that the default for access
is public: in struct and private: in class. The choice of one or the other
is mostly a personal one. (Well, use struct{} for things with many data
members but few methods, class{} for all other ones, is a good rule
though)


Ciao,
Michael.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic