struct vs. class

Andreas Pakulat apaku at gmx.de
Fri Dec 28 21:01:10 UTC 2007


On 28.12.07 22:20:15, Vladimir Prus wrote:
> Andreas Pakulat wrote:
> > Hi,
> >
> > building kdevelop with msvc I get tons of warnings because classes are
> > often forward-declared as class Foo, while they're defined as struct Foo
> > in the header (or the other way around). That makes it hard to see
> > actual erros during compilation.
> >
> > So I'd like to know wether there are objections against changing all
> > code from using struct to class (including the needed public:
> > declaration). Especially are there speed or memory drawbacks using class
> > instead of struct? (I'm thinking about duchain and related stuff, where
> > there may be reasons to keep struct)
> >   
> 
> 'class' and 'struct' should be the same, except for different default
> visibility.

I conclude that means I don't have to worry :)

> And the struct vs. class warning is rather pointless, but formally
> correct.

Yeah I know. Its really just so I (and in the future hopefully others
porting to win32) don't get broken eyes by searching for the actual
error. 

Andreas

-- 
Don't feed the bats tonight.




More information about the KDevelop-devel mailing list