mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
#include <type_traits>
|
|
#include <DataTypes/DataTypeNumberBase.h>
|
|
#include <Columns/ColumnVector.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
template <typename T>
|
|
Field DataTypeNumberBase<T>::getDefault() const
|
|
{
|
|
return NearestFieldType<FieldType>();
|
|
}
|
|
template <typename T>
|
|
MutableColumnPtr DataTypeNumberBase<T>::createColumn() const
|
|
{
|
|
return ColumnVector<T>::create();
|
|
}
|
|
|
|
template <typename T>
|
|
bool DataTypeNumberBase<T>::isValueRepresentedByInteger() const
|
|
{
|
|
return is_integer<T>;
|
|
}
|
|
|
|
template <typename T>
|
|
bool DataTypeNumberBase<T>::isValueRepresentedByUnsignedInteger() const
|
|
{
|
|
return is_integer<T> && is_unsigned_v<T>;
|
|
}
|
|
|
|
/// Explicit template instantiations - to avoid code bloat in headers.
|
|
template class DataTypeNumberBase<UInt8>;
|
|
template class DataTypeNumberBase<UInt16>;
|
|
template class DataTypeNumberBase<UInt32>;
|
|
template class DataTypeNumberBase<UInt64>;
|
|
template class DataTypeNumberBase<UInt128>;
|
|
template class DataTypeNumberBase<UInt256>;
|
|
template class DataTypeNumberBase<Int8>;
|
|
template class DataTypeNumberBase<Int16>;
|
|
template class DataTypeNumberBase<Int32>;
|
|
template class DataTypeNumberBase<Int64>;
|
|
template class DataTypeNumberBase<Int128>;
|
|
template class DataTypeNumberBase<Int256>;
|
|
template class DataTypeNumberBase<Float32>;
|
|
template class DataTypeNumberBase<Float64>;
|
|
|
|
}
|