From af369483a9c36afda06aba384d0fdb06abea3f54 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Thu, 13 Sep 2018 22:59:03 +0800 Subject: [PATCH] Simply Self. > When the normal name of the template (i.e., the name from the enclosing scope, not the injected-class-name) is used, it always refers to the class template itself and not a specialization of the template http://eel.is/c++draft/temp.local --- .../AggregateFunctions/AggregateFunctionMinMaxAny.h | 12 ++++++------ dbms/src/Columns/ColumnDecimal.h | 2 +- dbms/src/Columns/ColumnVector.h | 2 +- dbms/src/Common/HashTable/HashSet.h | 2 +- dbms/src/Common/HashTable/HashTable.h | 2 +- dbms/src/Common/HashTable/SmallTable.h | 2 +- dbms/src/Common/HashTable/TwoLevelHashTable.h | 2 +- dbms/src/Common/SpaceSaving.h | 2 +- dbms/src/DataStreams/UnionBlockInputStream.h | 2 +- dbms/src/Interpreters/SystemLog.h | 2 +- libs/libcommon/include/common/strong_typedef.h | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMinMaxAny.h b/dbms/src/AggregateFunctions/AggregateFunctionMinMaxAny.h index 19dd795e8fe..a2dbd21a342 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMinMaxAny.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMinMaxAny.h @@ -24,7 +24,7 @@ template struct SingleValueDataFixed { private: - using Self = SingleValueDataFixed; + using Self = SingleValueDataFixed; bool has_value = false; /// We need to remember if at least one value has been passed. This is necessary for AggregateFunctionIf. T value; @@ -563,7 +563,7 @@ public: template struct AggregateFunctionMinData : Data { - using Self = AggregateFunctionMinData; + using Self = AggregateFunctionMinData; bool changeIfBetter(const IColumn & column, size_t row_num, Arena * arena) { return this->changeIfLess(column, row_num, arena); } bool changeIfBetter(const Self & to, Arena * arena) { return this->changeIfLess(to, arena); } @@ -574,7 +574,7 @@ struct AggregateFunctionMinData : Data template struct AggregateFunctionMaxData : Data { - using Self = AggregateFunctionMaxData; + using Self = AggregateFunctionMaxData; bool changeIfBetter(const IColumn & column, size_t row_num, Arena * arena) { return this->changeIfGreater(column, row_num, arena); } bool changeIfBetter(const Self & to, Arena * arena) { return this->changeIfGreater(to, arena); } @@ -585,7 +585,7 @@ struct AggregateFunctionMaxData : Data template struct AggregateFunctionAnyData : Data { - using Self = AggregateFunctionAnyData; + using Self = AggregateFunctionAnyData; bool changeIfBetter(const IColumn & column, size_t row_num, Arena * arena) { return this->changeFirstTime(column, row_num, arena); } bool changeIfBetter(const Self & to, Arena * arena) { return this->changeFirstTime(to, arena); } @@ -596,7 +596,7 @@ struct AggregateFunctionAnyData : Data template struct AggregateFunctionAnyLastData : Data { - using Self = AggregateFunctionAnyLastData; + using Self = AggregateFunctionAnyLastData; bool changeIfBetter(const IColumn & column, size_t row_num, Arena * arena) { return this->changeEveryTime(column, row_num, arena); } bool changeIfBetter(const Self & to, Arena * arena) { return this->changeEveryTime(to, arena); } @@ -615,7 +615,7 @@ struct AggregateFunctionAnyHeavyData : Data { size_t counter = 0; - using Self = AggregateFunctionAnyHeavyData; + using Self = AggregateFunctionAnyHeavyData; bool changeIfBetter(const IColumn & column, size_t row_num, Arena * arena) { diff --git a/dbms/src/Columns/ColumnDecimal.h b/dbms/src/Columns/ColumnDecimal.h index 0b37c5337de..e580302f591 100644 --- a/dbms/src/Columns/ColumnDecimal.h +++ b/dbms/src/Columns/ColumnDecimal.h @@ -58,7 +58,7 @@ class ColumnDecimal final : public COWPtrHelper> static_assert(IsDecimalNumber); private: - using Self = ColumnDecimal; + using Self = ColumnDecimal; friend class COWPtrHelper; public: diff --git a/dbms/src/Columns/ColumnVector.h b/dbms/src/Columns/ColumnVector.h index af56a841c3d..b1e89e413c9 100644 --- a/dbms/src/Columns/ColumnVector.h +++ b/dbms/src/Columns/ColumnVector.h @@ -125,7 +125,7 @@ class ColumnVector final : public COWPtrHelper> static_assert(!IsDecimalNumber); private: - using Self = ColumnVector; + using Self = ColumnVector; friend class COWPtrHelper; struct less; diff --git a/dbms/src/Common/HashTable/HashSet.h b/dbms/src/Common/HashTable/HashSet.h index 7f941aeefde..f506197f343 100644 --- a/dbms/src/Common/HashTable/HashSet.h +++ b/dbms/src/Common/HashTable/HashSet.h @@ -27,7 +27,7 @@ template class HashSetTable : public HashTable { public: - using Self = HashSetTable; + using Self = HashSetTable; using Cell = TCell; void merge(const Self & rhs) diff --git a/dbms/src/Common/HashTable/HashTable.h b/dbms/src/Common/HashTable/HashTable.h index bb731083e4d..adf6785c3aa 100644 --- a/dbms/src/Common/HashTable/HashTable.h +++ b/dbms/src/Common/HashTable/HashTable.h @@ -269,7 +269,7 @@ protected: friend class TwoLevelHashTable; using HashValue = size_t; - using Self = HashTable; + using Self = HashTable; using cell_type = Cell; size_t m_size = 0; /// Amount of elements diff --git a/dbms/src/Common/HashTable/SmallTable.h b/dbms/src/Common/HashTable/SmallTable.h index d8e4c519a64..73c2b358652 100644 --- a/dbms/src/Common/HashTable/SmallTable.h +++ b/dbms/src/Common/HashTable/SmallTable.h @@ -29,7 +29,7 @@ protected: friend class iterator; friend class Reader; - using Self = SmallTable; + using Self = SmallTable; using cell_type = Cell; size_t m_size = 0; /// Amount of elements. diff --git a/dbms/src/Common/HashTable/TwoLevelHashTable.h b/dbms/src/Common/HashTable/TwoLevelHashTable.h index bdac3c32b4a..da665abfb4c 100644 --- a/dbms/src/Common/HashTable/TwoLevelHashTable.h +++ b/dbms/src/Common/HashTable/TwoLevelHashTable.h @@ -43,7 +43,7 @@ protected: friend class iterator; using HashValue = size_t; - using Self = TwoLevelHashTable; + using Self = TwoLevelHashTable; public: using Impl = ImplTable; diff --git a/dbms/src/Common/SpaceSaving.h b/dbms/src/Common/SpaceSaving.h index 08d392bf56d..27477e4f9a2 100644 --- a/dbms/src/Common/SpaceSaving.h +++ b/dbms/src/Common/SpaceSaving.h @@ -83,7 +83,7 @@ private: } public: - using Self = SpaceSaving; + using Self = SpaceSaving; struct Counter { diff --git a/dbms/src/DataStreams/UnionBlockInputStream.h b/dbms/src/DataStreams/UnionBlockInputStream.h index 71e72672aa3..0a2be37da8b 100644 --- a/dbms/src/DataStreams/UnionBlockInputStream.h +++ b/dbms/src/DataStreams/UnionBlockInputStream.h @@ -69,7 +69,7 @@ public: using ExceptionCallback = std::function; private: - using Self = UnionBlockInputStream; + using Self = UnionBlockInputStream; public: UnionBlockInputStream(BlockInputStreams inputs, BlockInputStreamPtr additional_input_at_end, size_t max_threads, diff --git a/dbms/src/Interpreters/SystemLog.h b/dbms/src/Interpreters/SystemLog.h index 21c0cd8ba1c..b99877b3046 100644 --- a/dbms/src/Interpreters/SystemLog.h +++ b/dbms/src/Interpreters/SystemLog.h @@ -76,7 +76,7 @@ class SystemLog : private boost::noncopyable { public: - using Self = SystemLog; + using Self = SystemLog; /** Parameter: table name where to write log. * If table is not exists, then it get created with specified engine. diff --git a/libs/libcommon/include/common/strong_typedef.h b/libs/libcommon/include/common/strong_typedef.h index 8f62513ff75..ae502b4ef97 100644 --- a/libs/libcommon/include/common/strong_typedef.h +++ b/libs/libcommon/include/common/strong_typedef.h @@ -12,7 +12,7 @@ struct StrongTypedef , boost::totally_ordered2< StrongTypedef, T> > { private: - using Self = StrongTypedef; + using Self = StrongTypedef; T t; public: