[openbeos] Re: C++ Compatibility

  • From: Marcus Overhagen <dos4gw@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Mon, 18 Mar 2002 01:52:58 +0100

openbeos@xxxxxxxxxxxxx schrieb am 18.03.02:
> I really like some features in C++.  Like the type casting operators, 
sometimes a dynamic_cast<> is useful, sometimes not.

> classes, and other things.  Unfortunately, I can't tell gcc to make 
> sure I do these things correctly...well, I can but if I do I'll get 
> hundreds apon hundreds of warnings about non-c++ ways of doing things 
> from withen the system header files.  If you properly include the c++ 
Are you sure? Can you post examples?

> headers (the ones with no file extention) you should not get these 
> warnings.
Are you referring to the the STL that is distributed with BeOS R5, or to
the Be headers like Application.h, Window.h,... ?

> I would like to request that the wonderful coders of OpenBeOS make sure 
> that the header files follow the c++ standards where possible.
I think most of them do it already.

> 
> The biggest problems that I noticed are these:
>       -Not using the c++ type casting operators
In headers? But where?

I know that I used them sometimes, for example in
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/open-beos/media_kit/source/lib/SampleConverter.cpp?rev=1.3&content-type=text/vnd.viewcvs-markup
But what is so bad about a C style cast, if it is used properly?
Whenever a dymic_cast<> is necessary, I would use it.

>       -Copy constructor missing if there are pointer data types in the class
It should be missing on purpose, beeing place in the "private:" section
of the class, if it is not implemented, and does not make sense.
In all other places where it is not implemented and can be used by
accident (and doing flat copies of pointer), we can fix it, by
adding them.


>       -Not using the initializer list in the constructors of classes
Sometimes not easily possible, but in the simple case, it should be used, 
agreed.

regards
Marcus
______________________________________________________________________________
Ohne Risiko spielend zum Börsenguru werden. Haben Sie schon eine
Strategie? Spekulieren und tolle Preis gewinnen http://boersenspiel.web.de


Other related posts: