[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: c++ question: code duplication across classes
From:       Sylvain Joyeux <sylvain.joyeux () polytechnique ! org>
Date:       2006-09-20 9:16:37
Message-ID: 200609201116.37748.sylvain.joyeux () polytechnique ! org
[Download RAW message or body]

> > No, you would have at most one vtable per DSO. Moreover, the ABI used by
> > latest g++s also mandates that the vtable is shared across DSOs
>
> erm, could you please tell me what is a DSO? I saw it stands for Dynamic
> Shared Object, but I don't understand what that is.
On linux, they are the .so binaries, on .dll on Windows. Libraries which are 
shared in more than one executable. The problem with DSOs and template 
classes is that the template gets instanciated in each DSO it is used, and if 
it has virtual methods, a vtable is defined in each DSO. In latest versions 
of the libc, the dynamic loader is supposed to merge these definitions.

> which one would you choose?
CRTP or global functions. I really like the CRTP (which stands for "Curiously 
Recurring Template Pattern btw), so I'll go with it. But if you're more 
confident with global functions, use them.
-- 
Sylvain
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic