
On Fri, 23 Jul 2004 13:49:22 +0400, Vladimir Prus <ghost@cs.msu.su> wrote:
static imported_function<void()> apiFunc( "ApiFunc", "OSLib" );
Couldn't find a nice point in the thread at which to insert this comment, so I'll just spit it out: Since we have both the name of the function and the function type, and given that a lib such as this should provide a platform-independent interface, would it be useful if the library automatically mangled the name according to the type? Pros: * Type mismatches in arguments etc will be caught. * Possible to export multiple overloads of the same function name. * In the event that the imported library cannot be changed to use extern "C", it is still possible to import the function without resorting to platform-specific mangling in the function name string. Cons: * May cause problems if multiple mangling schemes exist on a single (OS) platform. * Not all mangling schemes are documented well or provide an API to perform the mangling. * Some (most likely insignificant) run-time and code-size overhead. /Mattias