On 2014-10-02 05:45, Antony Polukhin wrote:
2014-10-02 16:18 GMT+04:00 Mathias Gaunard
: [...] - I did not find any rationale for the alias mechanism. Surely you can work with C++ symbols without needing to alias them with a C name?
Yes, you can. Though C++ name will be mangled and some `void boost::foo(std::sting)` will change to something like `N5boostN3foosE`. Importing function by `N5boostN3foosE` name does not looks user friendly, especially assuming the fact that different compilers have different mangling scheme.
The alias name - is a not mangled name for C++ symbol.
In my mind, the single most useful feature of a library like this would be to add type-safety to GetProcAddress(), essentially. i.e. specify the the type and name, the library mangles it and loads it and returns the correct function pointer type. It's not clear to me why you need to wrap the functions in a std::function (but I've only skimmed the documentation still). -- Arvid Norberg