On Friday 03 October 2014 23:59:03 Niall Douglas wrote:
On 3 Oct 2014 at 19:09, Andrey Semashev wrote:
I think any such technique is non-portable since there is no portable way to obtain mangled name of a function in compile time.
Who cares.
I do, obviously.
All the major compilers do provide this, and a large number of the minor ones. When myself and Antony surveyed the situation during TypeIndex we were pleasantly surprised at just how widespread support is for some magic macro which expands to the mangled form of the enclosing function. Mangling schemes have also basically reduced to just two kinds in recent compilers, with the Microsoft mangling scheme considerably the harder to parse. Mangling schemes are also very stable over time. That makes this proposal tractable.
We had a similar discussion already. IMO, the library in its core should not rely on compiler specific features and should be implementable in pure C++ and standard APIs. This ensures its portability. It doesn't matter how many compilers implement the extension because there will always be the one that doesn't. In any case, I don't think that mangled names are useful for other reasons I mentioned.