[PATCH] KUser and new class KGroup
Oswald Buddenhagen
ossi at kde.org
Fri Jun 4 14:03:22 BST 2004
On Fri, Jun 04, 2004 at 11:00:31AM +0200, Jan Schäfer wrote:
> - - inline the = method
>
forget that, i was stupid.
first, you should write a "proper" constructor:
KUserGroup( const KUserGroup& src ) : d( src.d ) {}
then d is not initialized with the default constructor first.
as the resulting code is different from the assignment operator anyway
(i forgot the implicit d initialization), the inlining idea is moot (if
the code would be the same, it would have made sense to alias one to the
other this way:
class KUserGroup {
public:
KUserGroup( const KUserGroup& src ) { *this = src; }
}
but using inline for simply aliasing is a stupid idea in c++ anyway, as
the compiler always creates backup copies of the inline function, thus
one does not save (exported) symbols, on the contrary (there is one backup
copy in every object including the class declaration). using inline for
pure aliasing works only outside class definitions when one prepends
"static" to the "inline").
greetings
--
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
More information about the kde-core-devel
mailing list