mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
fix build
This commit is contained in:
parent
4d8f5f9c34
commit
51860191eb
@ -227,12 +227,13 @@ private:
|
|||||||
Derived * derived() { return static_cast<Derived *>(this); }
|
Derived * derived() { return static_cast<Derived *>(this); }
|
||||||
const Derived * derived() const { return static_cast<const Derived *>(this); }
|
const Derived * derived() const { return static_cast<const Derived *>(this); }
|
||||||
|
|
||||||
template<typename Class, typename... Args>
|
template<typename Class, typename Res, typename... Args>
|
||||||
struct HasCreateImmutable<Args...> {
|
struct HasCreateImmutable
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static constexpr auto check(T *) -> typename std::is_same<
|
static constexpr auto check(T *) -> typename std::is_same<
|
||||||
decltype( std::declval<T>().createImmutable( std::declval<Args>()... ) ), Ptr
|
decltype( std::declval<T>().createImmutable( std::declval<Args>()... ) ), Res
|
||||||
>::type;
|
>::type;
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
@ -251,7 +252,7 @@ public:
|
|||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
static auto create(Args &&... args)
|
static auto create(Args &&... args)
|
||||||
{
|
{
|
||||||
if constexpr (HasCreateImmutable<Derived, args ...>)
|
if constexpr (HasCreateImmutable<Derived, Ptr, Args ...>::value)
|
||||||
return Derived::createImmutable(std::forward<Args>(args)...);
|
return Derived::createImmutable(std::forward<Args>(args)...);
|
||||||
else
|
else
|
||||||
return MutablePtr(new Derived(std::forward<Args>(args)...));
|
return MutablePtr(new Derived(std::forward<Args>(args)...));
|
||||||
|
Loading…
Reference in New Issue
Block a user