Type-safe classes in Boost.Extension:
, instance: An instance must be used only with the
from which it was created. Other than this, these two classes are type safe.
: The get functions for this class do not guarantee type safety. This is caused by the fact that the underlying operating system-specific functions return void pointers that must be converted to function pointers.
To help alleviate type safety issues when using
it is recommended that a common function signature be used in each shared library.
The library provides shortcuts for this technique, which are used in boost_extension.tutorials.tutorial02.
To help overcome the type safety problems with the instance
class, it would be possible to have each instance
contain a reference to the
that created it, and then only allow that functions from that
called. The plan is to add this as an option, which can be disabled with a
preprocessor macro, but it may be added permanently, depending on input from
the Boost community.