Style of libstdc++ header files

Wolfgang Bangerth bangerth@ices.utexas.edu
Tue Sep 14 19:17:00 GMT 2004


> I surely do not understand why it would be more difficult to turn the
> inline definition into a declaration instead of simply deleting it...

That's actually simple to illustrate: think
  class X{
    void method1 () {...}
    void method2 () {...}
    void method3 () {...}
    void method4 () {...}
  };
In order to convert these four definitions into declarations, four edit 
operations (mark everything from "{" to "}" and delete) are necessary.

On the other hand, if the code looked like
  class X{
    void method1 ();
    void method2 ();
    void method3 ();
    void method4 ();
  }

  void X::method1 () {...}
  void X::method2 () {...}
  void X::method3 () {...}
  void X::method4 () {...}
then I can remove the whole block of definitions with one edit operation (mark 
everything from the line of the first to the line with the last definition 
and delete). 

Since the STL container, string, and iostream classes usually have several 
dozen functions, editing every single member function can be a very tedious 
process.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/



More information about the Libstdc++ mailing list