Torque 3D 3.7
DelegateMemento Class
class DelegateMemento;

DelegateMemento - Evil version 

For compilers where data pointers are at least as big as code pointers, it is possible to store the function pointer in the this pointer, using another horrible_cast. In this case the DelegateMemento implementation is simple: +--pThis --+-- pMemFunc-+-- Meaning---------------------+ | 0 | 0 | Empty | | !=0 | !=0* | Static function or method call| +----------+------------+-------------------------------+

  • For Metrowerks, this can be 0. (first virtual function in a single_inheritance class).

Note that the Sun C++ and MSVC documentation explicitly state that they support static_cast between void * and function pointers.

Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!