Boost logo

Boost :

Subject: Re: [boost] virtual function templates
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-02-23 19:32:30


Bob Walters a écrit :
> On Sat, Feb 20, 2010 at 6:09 AM, <strasser_at_[hidden]> wrote:
>> Hi,
>>
>> is there interest in a boost utility to implement (pseudo-) virtual function
>> templates?
>
> I've been looking for a way to implement virtual-functions for cases where the
> objects in question are stored within shared memory region, thus presenting the
> challenge that the overridden function addresses might be different
> for different
> processes.

Typically, the function addresses lie within the vtable, not the object
(the object has a pointer to the vtable). The vtable is in static
memory, and contains function pointers as well as other things.

> Would that be accommodated by your approach, or are you in fact storing
> pointers to functions on the base type?

While you would avoid the need to have the vtable at the same address,
ultimately this doesn't appear to be sufficient to solve the problem:
you would still need the function to be at the same address in memory.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk