#pragma once #include namespace DB { template static bool castTypeToEither(const T * type, F && f) { /// XXX can't use && here because gcc-7 complains about parentheses around && within || return ((typeid_cast(type) ? f(*typeid_cast(type)) : false) || ...); } }