Skip to content

Commit 86225ad

Browse files
authored
Merge pull request #328 from bduminiuc/move_data_enum_column
Add move semantics for ColumnEnum
2 parents a133b50 + da3048b commit 86225ad

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clickhouse/columns/enum.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ ColumnEnum<T>::ColumnEnum(TypeRef type, const std::vector<T>& data)
2020
{
2121
}
2222

23+
template <typename T>
24+
ColumnEnum<T>::ColumnEnum(TypeRef type, std::vector<T>&& data)
25+
: Column(type)
26+
, data_(std::move(data))
27+
{
28+
}
29+
2330
template <typename T>
2431
void ColumnEnum<T>::Append(const T& value, bool checkValue) {
2532
if (checkValue) {

clickhouse/columns/enum.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ColumnEnum : public Column {
1212

1313
ColumnEnum(TypeRef type);
1414
ColumnEnum(TypeRef type, const std::vector<T>& data);
15+
ColumnEnum(TypeRef type, std::vector<T>&& data);
1516

1617
/// Appends one element to the end of column.
1718
void Append(const T& value, bool checkValue = false);

0 commit comments

Comments
 (0)