9 ms·
You could do: template<class R, class... Args> struct FnBase { virtual R operator()(Args...) = 0; }; class MyThread : FnBase<void> { ..
by gpderetta 1y ago
You could do:
template<class R, class... Args>
struct FnBase {
virtual R operator()(Args...) = 0;
};
class MyThread : FnBase<void> { ... };
- mwkaufma 1y agoThis is pithy and clever, but in exchange makes the code less obviously self-documenting (implementation details creeping into type declarations) and complicates implementing multiple interfaces on the same receiver.