#pragma once #include #include namespace DB { template static bool castTypeToEither(const T * type, F && f) { return ((typeid_cast(type) && f(*typeid_cast(type))) || ...); } template static bool castTypeToEither(TypeList, const auto * type, auto && f) { return ((typeid_cast(type) != nullptr && std::forward(f)(*typeid_cast(type))) || ...); } }