[cfe-users] Compiler extensions for fast delegates

Piotr Wyderski via cfe-users cfe-users at lists.llvm.org
Thu Aug 25 05:16:20 PDT 2016


Hello,

this is my first posting to this group, so please feel free
to correct me if it is inaproppriate in any way.

The problem: would the Clang C++ compiler developers
consider providing *any* support for efficient and low memory
overhead delegates in C++? There certainly is std::function
which, together with std::bind, can simulate delegates, but its
enormous genericity results in poor performance, which makes
this combo not a very attractive option. There is also a number
of allegedly 'fastes possible delegates', which work thanks to
filthy hacks, but their implementations are themselves excercises
in madness just because the language does not provide
the necessary support for bound member function pointers.
GCC has an extension which allows casting a pmf into an
ordinary function pointer, but this is not supported in Clang
for various reasons and this situation is not expected to change.
So could you please consider providing anything that matches
the "Clang philosophy", so to speak, and could simplify writing efficient
and compact delegates?

I am porting my codebase from GCC to Clang and don't
care about portability issues -- the compiler will always be Clang
and Clang only.

    Best regards, Piotr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20160825/34f184f2/attachment.html>


More information about the cfe-users mailing list