vtbl jamming

Lutger lutger.blijdestijn at gmail.com
Mon Sep 10 03:58:03 PDT 2007


BCS wrote:
> can we get some way to do this?
> 
> http://www.artima.com/cppsource/backyard2.html
> 
> 

We can do it the same way in D, perhaps it can be done better. Or is 
that what you're asking? If so, ignore this then:

At least the caveats mentioned in the article either do not exist 
(standard ABI) or can be checked at compile time.

This seems to work in D as well:

class Collection
{
     void toSingle()
     {
         *(cast(void**)this) = *(cast(void**)SingleThreadedCollection.tmp);
     }
}



More information about the Digitalmars-d mailing list