Re: [sigc] Implementatoin in .cc file



Martin Schulze writes:
 > The problem is that I don't have a c++ book at hand. Could you
 > please make clear whether in an optimized build gcc automatically
 > marks member functions that are implemented in the class definition
 > as inline? I.e. are the functions in slot_base and so on currently
 > inline?

g++(1) shows a switch to turn this off:

       -fno-default-inline
           Do not assume inline for functions defined inside a class scope.
             Note that these functions will have linkage like inline func-
           tions; they just won't be inlined by default.

which implies that it is on by default.

 > As a general rule I like having "one-line" functions inline and in
 > the case of sigc++ also most short functions that get executed during
 > signal emission and connection/disconnection of slots.

Excessive use of inline can really suck if there is ever a need to
trace through the code in the debugger.  I'd much rather have easy
debugging than a few percent speed increase.
 
-Brett.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]