This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Style of libstdc++ header files


> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]