A Type for Overload Set
biowpn.github.io
biowpn.github.io
On the other hand, I don't even know how transform is defined. C++ has nothing exactly like IEnumerable<T>, so maybe it is hard to refer to the T? And of course what the article references, that there is no way to refer to the overload set.
I usually like C++, but it is not fun when the abstractions break like that.
>There is a recent proposal that aims to address this exact issue: P3312 - Overload Set Types.
Painfully common story.
#define FWD(...) ::std::forward<decltype(__VA_ARGS__)>(__VA_ARGS__)
#define LIFT_CUSTOM(X, CAPTURE) CAPTURE (auto &&... args) \
noexcept(noexcept(X(FWD(args)...))) -> decltype((X(FWD(args)...))) { \
return X(FWD(args)...); \
}
#define LIFT(X) LIFT_CUSTOM(X, [&])