From: Grzegorz J. <ja...@he...> - 2003-03-11 01:42:46
|
On Mon, 10 Mar 2003, Michael Hohmuth wrote: > Grzegorz Jakacki <ja...@he...> writes: > > > You have been added to the project. Currently Alexandre Tolmos is > > finishing his commits wrt. gcc-3.x, there will be an annoucement once he > > is done. Before this happens you may want to contact me if you think you > > need any help on branching/merging. > > Thanks. > > I don't think I need any help with merging, but I would like to have > some feedback. > > I observed that in the current CVS version (which supposedly already > contains some or all of the previous GCC3 work), there appear some > "using namespace std" declarations in header files. This, to my eyes, > is bad style. I am working on a project that uses OpenC++ as a > library, and there it potentially ``hurts'' if a header file imports > the whole std namespace into the global namespace. Agreed. > So, once Alexandre is finished, I would like to undo these changes and > instead revert to the style used in my patch: The "using namespace > std" declarations are only allowed to appear in .cc files, and .h > files reference std symbols using qualified names. Agreed. This is well covered in Herb Sutter's "More Exceptional C++", part of it is accessible at http://www.gotw.ca/gotw/053.htm . > There also is the issue of naming header files coming from standard > C. In my original patch, they are included as, for example, <cstring> > instead of <string.h>, whereas the current CVS version uses the > latter, older style. Here, I am planning to leave it at the CVS > version's style, because I think that it might be more portable. There is a trade-off here. It is more portable, but pollutes namespace --- functions from string.h are declared in global namespace, whereas functions from cstring are declared in 'std'. This is not very relevant when OpenC++ is compiled as application, but it is, when OpenC++ is used as a library. I would suggest that we stick to <cstring> style when writting new code, so that eventually old header style is eliminated. > Do you (Grzegorz, Alexande, or anyone else) have any objections? Only the above. Best regards Grzegorz ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |