struct vs. class

Vladimir Prus ghost at cs.msu.su
Fri Dec 28 19:20:15 UTC 2007


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.

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

- Volodya






More information about the KDevelop-devel mailing list