mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
16 lines
362 B
C++
16 lines
362 B
C++
#pragma once
|
|
|
|
#include <Common/typeid_cast.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
template <typename... Ts, typename T, typename F>
|
|
static bool castTypeToEither(const T * type, F && f)
|
|
{
|
|
/// XXX can't use && here because gcc-7 complains about parentheses around && within ||
|
|
return ((typeid_cast<const Ts *>(type) ? f(*typeid_cast<const Ts *>(type)) : false) || ...);
|
|
}
|
|
|
|
}
|