mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +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); }
|
||||
const Derived * derived() const { return static_cast<const Derived *>(this); }
|
||||
|
||||
template<typename Class, typename... Args>
|
||||
struct HasCreateImmutable<Args...> {
|
||||
template<typename Class, typename Res, typename... Args>
|
||||
struct HasCreateImmutable
|
||||
{
|
||||
private:
|
||||
template<typename T>
|
||||
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;
|
||||
|
||||
template<typename>
|
||||
@ -251,7 +252,7 @@ public:
|
||||
template <typename... 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)...);
|
||||
else
|
||||
return MutablePtr(new Derived(std::forward<Args>(args)...));
|
||||
|
Loading…
Reference in New Issue
Block a user