mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 18:45:20 +00:00
This is actually better
This commit is contained in:
parent
e85c695bcf
commit
a710ac6011
@ -7,13 +7,13 @@ namespace DB
|
|||||||
{
|
{
|
||||||
|
|
||||||
template <typename... Ts, typename T, typename F>
|
template <typename... Ts, typename T, typename F>
|
||||||
static NO_INLINE bool castTypeToEither(const T * type, F && f)
|
static bool castTypeToEither(const T * type, F && f)
|
||||||
{
|
{
|
||||||
return ((typeid_cast<const Ts *>(type) && f(*typeid_cast<const Ts *>(type))) || ...);
|
return ((typeid_cast<const Ts *>(type) && f(*typeid_cast<const Ts *>(type))) || ...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ...Args>
|
template <class ...Args>
|
||||||
static NO_INLINE bool castTypeToEither(TypeList<Args...>, const auto * type, auto && f)
|
static bool castTypeToEither(TypeList<Args...>, const auto * type, auto && f)
|
||||||
{
|
{
|
||||||
return ((typeid_cast<const Args *>(type) != nullptr && std::forward<decltype(f)>(f)(*typeid_cast<const Args *>(type))) || ...);
|
return ((typeid_cast<const Args *>(type) != nullptr && std::forward<decltype(f)>(f)(*typeid_cast<const Args *>(type))) || ...);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user