Код: Выделить всё
#define ifSigMatch(sig) if constexpr (std::is_same_v)
template void afoo(Foo f) {
ifSigMatch(void(T)) { ... }
ifSigMatch(bool(T)) { ... }
ifSigMatch(bool(T, int)) { ... }
...
}
Предпочтительно C++17 или более ранняя версия.
Подробнее здесь: https://stackoverflow.com/questions/783 ... tible-to-a
Мобильная версия