Browse Source

Restoring authorship annotation for <iroubin@yandex-team.ru>. Commit 1 of 2.

iroubin 3 years ago
parent
commit
94a4c65975

+ 32 - 32
util/generic/deque_ut.cpp

@@ -26,45 +26,45 @@ protected:
 
 
 UNIT_TEST_SUITE_REGISTRATION(TDequeTest);
 UNIT_TEST_SUITE_REGISTRATION(TDequeTest);
 
 
-void TDequeTest::TestConstructorsAndAssignments() {
+void TDequeTest::TestConstructorsAndAssignments() { 
     using container = TDeque<int>;
     using container = TDeque<int>;
-
-    container c1;
-    c1.push_back(100);
-    c1.push_back(200);
-
-    container c2(c1);
-
-    UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0));
-    UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1));
-
+ 
+    container c1; 
+    c1.push_back(100); 
+    c1.push_back(200); 
+ 
+    container c2(c1); 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0)); 
+    UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1)); 
+ 
     container c3(std::move(c1));
     container c3(std::move(c1));
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0));
-
-    c2.push_back(300);
-    c3 = c2;
-
-    UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2));
-
-    c2.push_back(400);
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0)); 
+ 
+    c2.push_back(300); 
+    c3 = c2; 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2)); 
+ 
+    c2.push_back(400); 
     c3 = std::move(c2);
     c3 = std::move(c2);
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3));
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3)); 
 
 
     int array[] = {2, 3, 4};
     int array[] = {2, 3, 4};
     container c4 = {2, 3, 4};
     container c4 = {2, 3, 4};
     UNIT_ASSERT_VALUES_EQUAL(c4, container(std::begin(array), std::end(array)));
     UNIT_ASSERT_VALUES_EQUAL(c4, container(std::begin(array), std::end(array)));
-}
-
+} 
+ 
 void TDequeTest::TestDeque1() {
 void TDequeTest::TestDeque1() {
     TDeque<int> d;
     TDeque<int> d;
     UNIT_ASSERT(!d);
     UNIT_ASSERT(!d);

+ 4 - 4
util/generic/hash.h

@@ -596,13 +596,13 @@ public:
                     deinitialize_buckets(buckets);
                     deinitialize_buckets(buckets);
                     initialize_buckets_dynamic(buckets, ht.buckets.ExtSize());
                     initialize_buckets_dynamic(buckets, ht.buckets.ExtSize());
                 }
                 }
-
+ 
                 copy_from_dynamic(ht);
                 copy_from_dynamic(ht);
             }
             }
         }
         }
         return *this;
         return *this;
     }
     }
-
+ 
     THashTable& operator=(THashTable&& ht) noexcept {
     THashTable& operator=(THashTable&& ht) noexcept {
         basic_clear();
         basic_clear();
         swap(ht);
         swap(ht);
@@ -1519,7 +1519,7 @@ public:
     // THashMap has implicit copy/move constructors and copy-/move-assignment operators
     // THashMap has implicit copy/move constructors and copy-/move-assignment operators
     // because its implementation is backed by THashTable.
     // because its implementation is backed by THashTable.
     // See hash_ut.cpp
     // See hash_ut.cpp
-
+ 
 public:
 public:
     size_type size() const noexcept {
     size_type size() const noexcept {
         return rep.size();
         return rep.size();
@@ -1844,7 +1844,7 @@ public:
     // THashMultiMap has implicit copy/move constructors and copy-/move-assignment operators
     // THashMultiMap has implicit copy/move constructors and copy-/move-assignment operators
     // because its implementation is backed by THashTable.
     // because its implementation is backed by THashTable.
     // See hash_ut.cpp
     // See hash_ut.cpp
-
+ 
 public:
 public:
     size_type size() const {
     size_type size() const {
         return rep.size();
         return rep.size();

+ 2 - 2
util/generic/hash_set.h

@@ -114,7 +114,7 @@ public:
     // THashSet has implicit copy/move constructors and copy-/move-assignment operators
     // THashSet has implicit copy/move constructors and copy-/move-assignment operators
     // because its implementation is backed by THashTable.
     // because its implementation is backed by THashTable.
     // See hash_ut.cpp
     // See hash_ut.cpp
-
+ 
 public:
 public:
     size_type size() const {
     size_type size() const {
         return rep.size();
         return rep.size();
@@ -363,7 +363,7 @@ public:
     // THashMultiSet has implicit copy/move constructors and copy-/move-assignment operators
     // THashMultiSet has implicit copy/move constructors and copy-/move-assignment operators
     // because its implementation is backed by THashTable.
     // because its implementation is backed by THashTable.
     // See hash_ut.cpp
     // See hash_ut.cpp
-
+ 
 public:
 public:
     size_type size() const {
     size_type size() const {
         return rep.size();
         return rep.size();

+ 125 - 125
util/generic/hash_ut.cpp

@@ -114,39 +114,39 @@ protected:
 
 
 UNIT_TEST_SUITE_REGISTRATION(THashTest);
 UNIT_TEST_SUITE_REGISTRATION(THashTest);
 
 
-void THashTest::TestHMapConstructorsAndAssignments() {
+void THashTest::TestHMapConstructorsAndAssignments() { 
     using container = THashMap<TString, int>;
     using container = THashMap<TString, int>;
-
-    container c1;
-    c1["one"] = 1;
-    c1["two"] = 2;
-
-    container c2(c1);
-
-    UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
+ 
+    container c1; 
+    c1["one"] = 1; 
+    c1["two"] = 2; 
+ 
+    container c2(c1); 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
     UNIT_ASSERT_VALUES_EQUAL(1, c1.at("one")); /* Note: fails under MSVC since it does not support implicit generation of move constructors. */
     UNIT_ASSERT_VALUES_EQUAL(1, c1.at("one")); /* Note: fails under MSVC since it does not support implicit generation of move constructors. */
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.at("two"));
-
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.at("two")); 
+ 
     container c3(std::move(c1));
     container c3(std::move(c1));
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(1, c3.at("one"));
-
-    c2["three"] = 3;
-    c3 = c2;
-
-    UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.at("three"));
-
-    c2["four"] = 4;
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(1, c3.at("one")); 
+ 
+    c2["three"] = 3; 
+    c3 = c2; 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.at("three")); 
+ 
+    c2["four"] = 4; 
     c3 = std::move(c2);
     c3 = std::move(c2);
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.at("four"));
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.at("four")); 
 
 
     const container c4{
     const container c4{
         {"one", 1},
         {"one", 1},
@@ -163,8 +163,8 @@ void THashTest::TestHMapConstructorsAndAssignments() {
 
 
     // non-existent values must be zero-initialized
     // non-existent values must be zero-initialized
     UNIT_ASSERT_VALUES_EQUAL(c1["nonexistent"], 0);
     UNIT_ASSERT_VALUES_EQUAL(c1["nonexistent"], 0);
-}
-
+} 
+ 
 void THashTest::TestHMap1() {
 void THashTest::TestHMap1() {
     using maptype = THashMap<char, TString, THash<char>, TEqualTo<char>>;
     using maptype = THashMap<char, TString, THash<char>, TEqualTo<char>>;
     maptype m;
     maptype m;
@@ -260,36 +260,36 @@ void THashTest::TestHMMapEqualityOperator() {
     UNIT_ASSERT(c3 != base);
     UNIT_ASSERT(c3 != base);
 }
 }
 
 
-void THashTest::TestHMMapConstructorsAndAssignments() {
+void THashTest::TestHMMapConstructorsAndAssignments() { 
     using container = THashMultiMap<TString, int>;
     using container = THashMultiMap<TString, int>;
-
-    container c1;
-    c1.insert(container::value_type("one", 1));
-    c1.insert(container::value_type("two", 2));
-
-    container c2(c1);
-
-    UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-
+ 
+    container c1; 
+    c1.insert(container::value_type("one", 1)); 
+    c1.insert(container::value_type("two", 2)); 
+ 
+    container c2(c1); 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
+ 
     container c3(std::move(c1));
     container c3(std::move(c1));
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-
-    c2.insert(container::value_type("three", 3));
-    c3 = c2;
-
-    UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-
-    c2.insert(container::value_type("four", 4));
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+ 
+    c2.insert(container::value_type("three", 3)); 
+    c3 = c2; 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+ 
+    c2.insert(container::value_type("four", 4)); 
     c3 = std::move(c2);
     c3 = std::move(c2);
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-}
-
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+} 
+ 
 void THashTest::TestHMMap1() {
 void THashTest::TestHMMap1() {
     using mmap = THashMultiMap<char, int, THash<char>, TEqualTo<char>>;
     using mmap = THashMultiMap<char, int, THash<char>, TEqualTo<char>>;
     mmap m;
     mmap m;
@@ -366,38 +366,38 @@ void THashTest::TestHMMapHas() {
     UNIT_ASSERT(!m.contains('Z'));
     UNIT_ASSERT(!m.contains('Z'));
 }
 }
 
 
-void THashTest::TestHSetConstructorsAndAssignments() {
+void THashTest::TestHSetConstructorsAndAssignments() { 
     using container = THashSet<int>;
     using container = THashSet<int>;
-
-    container c1;
-    c1.insert(100);
-    c1.insert(200);
-
-    container c2(c1);
-
-    UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
+ 
+    container c1; 
+    c1.insert(100); 
+    c1.insert(200); 
+ 
+    container c2(c1); 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
     UNIT_ASSERT(c1.contains(100));
     UNIT_ASSERT(c1.contains(100));
     UNIT_ASSERT(c2.contains(200));
     UNIT_ASSERT(c2.contains(200));
-
+ 
     container c3(std::move(c1));
     container c3(std::move(c1));
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
     UNIT_ASSERT(c3.contains(100));
     UNIT_ASSERT(c3.contains(100));
-
-    c2.insert(300);
-    c3 = c2;
-
-    UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
+ 
+    c2.insert(300); 
+    c3 = c2; 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
     UNIT_ASSERT(c3.contains(300));
     UNIT_ASSERT(c3.contains(300));
-
-    c2.insert(400);
+ 
+    c2.insert(400); 
     c3 = std::move(c2);
     c3 = std::move(c2);
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
     UNIT_ASSERT(c3.contains(400));
     UNIT_ASSERT(c3.contains(400));
 
 
     container c4 = {1, 2, 3};
     container c4 = {1, 2, 3};
@@ -405,8 +405,8 @@ void THashTest::TestHSetConstructorsAndAssignments() {
     UNIT_ASSERT(c4.contains(1));
     UNIT_ASSERT(c4.contains(1));
     UNIT_ASSERT(c4.contains(2));
     UNIT_ASSERT(c4.contains(2));
     UNIT_ASSERT(c4.contains(3));
     UNIT_ASSERT(c4.contains(3));
-}
-
+} 
+ 
 void THashTest::TestHSetSize() {
 void THashTest::TestHSetSize() {
     using container = THashSet<int>;
     using container = THashSet<int>;
 
 
@@ -421,16 +421,16 @@ void THashTest::TestHSetSize() {
     UNIT_ASSERT_VALUES_EQUAL(2, c.size());
     UNIT_ASSERT_VALUES_EQUAL(2, c.size());
 }
 }
 
 
-void THashTest::TestHSet2() {
+void THashTest::TestHSet2() { 
     THashSet<int, THash<int>, TEqualTo<int>> s;
     THashSet<int, THash<int>, TEqualTo<int>> s;
     auto p = s.insert(42);
     auto p = s.insert(42);
-    UNIT_ASSERT(p.second);
-    UNIT_ASSERT(*(p.first) == 42);
-
-    p = s.insert(42);
-    UNIT_ASSERT(!p.second);
-}
-
+    UNIT_ASSERT(p.second); 
+    UNIT_ASSERT(*(p.first) == 42); 
+ 
+    p = s.insert(42); 
+    UNIT_ASSERT(!p.second); 
+} 
+ 
 void THashTest::TestHSetEqualityOperator() {
 void THashTest::TestHSetEqualityOperator() {
     using container = THashSet<int>;
     using container = THashSet<int>;
 
 
@@ -457,41 +457,41 @@ void THashTest::TestHSetEqualityOperator() {
     UNIT_ASSERT(c3 != base);
     UNIT_ASSERT(c3 != base);
 }
 }
 
 
-void THashTest::TestHMSetConstructorsAndAssignments() {
+void THashTest::TestHMSetConstructorsAndAssignments() { 
     using container = THashMultiSet<int>;
     using container = THashMultiSet<int>;
-
-    container c1;
-    c1.insert(100);
-    c1.insert(200);
-
-    container c2(c1);
-
-    UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-    UNIT_ASSERT(c1.find(100) != c1.end());
-    UNIT_ASSERT(c2.find(200) != c2.end());
-
+ 
+    container c1; 
+    c1.insert(100); 
+    c1.insert(200); 
+ 
+    container c2(c1); 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
+    UNIT_ASSERT(c1.find(100) != c1.end()); 
+    UNIT_ASSERT(c2.find(200) != c2.end()); 
+ 
     container c3(std::move(c1));
     container c3(std::move(c1));
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-    UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-    UNIT_ASSERT(c3.find(100) != c3.end());
-
-    c2.insert(300);
-    c3 = c2;
-
-    UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-    UNIT_ASSERT(c3.find(300) != c3.end());
-
-    c2.insert(400);
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+    UNIT_ASSERT(c3.find(100) != c3.end()); 
+ 
+    c2.insert(300); 
+    c3 = c2; 
+ 
+    UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+    UNIT_ASSERT(c3.find(300) != c3.end()); 
+ 
+    c2.insert(400); 
     c3 = std::move(c2);
     c3 = std::move(c2);
-
-    UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-    UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-    UNIT_ASSERT(c3.find(400) != c3.end());
-}
-
+ 
+    UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+    UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+    UNIT_ASSERT(c3.find(400) != c3.end()); 
+} 
+ 
 void THashTest::TestHMSetSize() {
 void THashTest::TestHMSetSize() {
     using container = THashMultiSet<int>;
     using container = THashMultiSet<int>;
 
 

+ 4 - 4
util/generic/ptr.h

@@ -940,12 +940,12 @@ struct THash<TSharedPtr<T, C, D>>: THash<const T*> {
     }
     }
 };
 };
 
 
-template <class T, class D = TDelete>
-using TAtomicSharedPtr = TSharedPtr<T, TAtomicCounter, D>;
+template <class T, class D = TDelete> 
+using TAtomicSharedPtr = TSharedPtr<T, TAtomicCounter, D>; 
 
 
 // use with great care. if in doubt, use TAtomicSharedPtr instead
 // use with great care. if in doubt, use TAtomicSharedPtr instead
-template <class T, class D = TDelete>
-using TSimpleSharedPtr = TSharedPtr<T, TSimpleCounter, D>;
+template <class T, class D = TDelete> 
+using TSimpleSharedPtr = TSharedPtr<T, TSimpleCounter, D>; 
 
 
 template <typename T, typename C, typename... Args>
 template <typename T, typename C, typename... Args>
 [[nodiscard]] TSharedPtr<T, C> MakeShared(Args&&... args) {
 [[nodiscard]] TSharedPtr<T, C> MakeShared(Args&&... args) {

+ 56 - 56
util/generic/queue_ut.cpp

@@ -5,74 +5,74 @@
 #include <library/cpp/testing/unittest/registar.h>
 #include <library/cpp/testing/unittest/registar.h>
 
 
 #include <utility>
 #include <utility>
-
+ 
 Y_UNIT_TEST_SUITE(TYQueueTest) {
 Y_UNIT_TEST_SUITE(TYQueueTest) {
     Y_UNIT_TEST(ConstructorsAndAssignments) {
     Y_UNIT_TEST(ConstructorsAndAssignments) {
-        {
+        { 
             using container = TQueue<int>;
             using container = TQueue<int>;
-
-            container c1;
+ 
+            container c1; 
             UNIT_ASSERT(!c1);
             UNIT_ASSERT(!c1);
-            c1.push(100);
-            c1.push(200);
+            c1.push(100); 
+            c1.push(200); 
             UNIT_ASSERT(c1);
             UNIT_ASSERT(c1);
-
-            container c2(c1);
-
-            UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-            UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-
+ 
+            container c2(c1); 
+ 
+            UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
+ 
             container c3(std::move(c1));
             container c3(std::move(c1));
-
-            UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-            UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-
-            c2.push(300);
-            c3 = c2;
-
-            UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-            UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-
-            c2.push(400);
+ 
+            UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+ 
+            c2.push(300); 
+            c3 = c2; 
+ 
+            UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+ 
+            c2.push(400); 
             c3 = std::move(c2);
             c3 = std::move(c2);
-
-            UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-            UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-        }
-
-        {
+ 
+            UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+        } 
+ 
+        { 
             using container = TPriorityQueue<int>;
             using container = TPriorityQueue<int>;
-
-            container c1;
+ 
+            container c1; 
             UNIT_ASSERT(!c1);
             UNIT_ASSERT(!c1);
-            c1.push(100);
-            c1.push(200);
+            c1.push(100); 
+            c1.push(200); 
             UNIT_ASSERT(c1);
             UNIT_ASSERT(c1);
-
-            container c2(c1);
-
-            UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
-            UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-
+ 
+            container c2(c1); 
+ 
+            UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); 
+ 
             container c3(std::move(c1));
             container c3(std::move(c1));
-
-            UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
-            UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-
-            c2.push(300);
-            c3 = c2;
-
-            UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
-            UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-
-            c2.push(400);
+ 
+            UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); 
+ 
+            c2.push(300); 
+            c3 = c2; 
+ 
+            UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); 
+ 
+            c2.push(400); 
             c3 = std::move(c2);
             c3 = std::move(c2);
-
-            UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
-            UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
-        }
-    }
-
+ 
+            UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); 
+            UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); 
+        } 
+    } 
+ 
     Y_UNIT_TEST(pqueue1) {
     Y_UNIT_TEST(pqueue1) {
         TPriorityQueue<int, TDeque<int>, TLess<int>> q;
         TPriorityQueue<int, TDeque<int>, TLess<int>> q;
 
 

+ 20 - 20
util/generic/set_ut.cpp

@@ -198,71 +198,71 @@ Y_UNIT_TEST_SUITE(YSetTest) {
             container c1;
             container c1;
             c1.insert(100);
             c1.insert(100);
             c1.insert(200);
             c1.insert(200);
-
+ 
             container c2(c1);
             container c2(c1);
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
             UNIT_ASSERT(c1.contains(100));
             UNIT_ASSERT(c1.contains(100));
             UNIT_ASSERT(c2.contains(200));
             UNIT_ASSERT(c2.contains(200));
-
+ 
             container c3(std::move(c1));
             container c3(std::move(c1));
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
             UNIT_ASSERT(c3.contains(100));
             UNIT_ASSERT(c3.contains(100));
-
+ 
             c2.insert(300);
             c2.insert(300);
             c3 = c2;
             c3 = c2;
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
             UNIT_ASSERT(c3.contains(300));
             UNIT_ASSERT(c3.contains(300));
-
+ 
             c2.insert(400);
             c2.insert(400);
             c3 = std::move(c2);
             c3 = std::move(c2);
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
             UNIT_ASSERT(c3.contains(400));
             UNIT_ASSERT(c3.contains(400));
         }
         }
-
+ 
         {
         {
             using container = TMultiSet<int>;
             using container = TMultiSet<int>;
-
+ 
             container c1;
             container c1;
             c1.insert(100);
             c1.insert(100);
             c1.insert(200);
             c1.insert(200);
-
+ 
             container c2(c1);
             container c2(c1);
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
             UNIT_ASSERT(c1.find(100) != c1.end());
             UNIT_ASSERT(c1.find(100) != c1.end());
             UNIT_ASSERT(c2.find(200) != c2.end());
             UNIT_ASSERT(c2.find(200) != c2.end());
-
+ 
             container c3(std::move(c1));
             container c3(std::move(c1));
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
             UNIT_ASSERT(c3.find(100) != c3.end());
             UNIT_ASSERT(c3.find(100) != c3.end());
-
+ 
             c2.insert(300);
             c2.insert(300);
             c3 = c2;
             c3 = c2;
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
             UNIT_ASSERT(c3.find(300) != c3.end());
             UNIT_ASSERT(c3.find(300) != c3.end());
-
+ 
             c2.insert(400);
             c2.insert(400);
             c3 = std::move(c2);
             c3 = std::move(c2);
-
+ 
             UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
             UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
             UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
             UNIT_ASSERT(c3.find(400) != c3.end());
             UNIT_ASSERT(c3.find(400) != c3.end());
         }
         }
-    }
-
+    } 
+ 
     struct TKey {
     struct TKey {
         TKey()
         TKey()
             : m_data(0)
             : m_data(0)

+ 15 - 15
util/generic/typetraits_ut.cpp

@@ -272,8 +272,8 @@ namespace {
         enum { IsConstant = false };
         enum { IsConstant = false };
         enum { IsPointer = false };
         enum { IsPointer = false };
         enum { IsReference = false };
         enum { IsReference = false };
-        enum { IsLvalueReference = false };
-        enum { IsRvalueReference = false };
+        enum { IsLvalueReference = false }; 
+        enum { IsRvalueReference = false }; 
         enum { IsArray = false };
         enum { IsArray = false };
         enum { IsClassType = false };
         enum { IsClassType = false };
         enum { IsVoid = true };
         enum { IsVoid = true };
@@ -332,16 +332,16 @@ namespace {
     struct TTypeTraitsExpected<TNonPodClass&>: public TTypeTraitsExpected<TNonPodClass> {
     struct TTypeTraitsExpected<TNonPodClass&>: public TTypeTraitsExpected<TNonPodClass> {
         enum { IsClassType = false };
         enum { IsClassType = false };
         enum { IsReference = true };
         enum { IsReference = true };
-        enum { IsLvalueReference = true };
+        enum { IsLvalueReference = true }; 
     };
     };
 
 
     template <>
     template <>
     struct TTypeTraitsExpected<TNonPodClass&&>: public TTypeTraitsExpected<TNonPodClass> {
     struct TTypeTraitsExpected<TNonPodClass&&>: public TTypeTraitsExpected<TNonPodClass> {
-        enum { IsClassType = false };
-        enum { IsReference = true };
-        enum { IsRvalueReference = true };
-    };
-
+        enum { IsClassType = false }; 
+        enum { IsReference = true }; 
+        enum { IsRvalueReference = true }; 
+    }; 
+ 
     template <>
     template <>
     struct TTypeTraitsExpected<const TNonPodClass&>: public TTypeTraitsExpected<TNonPodClass&> {
     struct TTypeTraitsExpected<const TNonPodClass&>: public TTypeTraitsExpected<TNonPodClass&> {
     };
     };
@@ -357,17 +357,17 @@ namespace {
     struct TTypeTraitsExpected<float&>: public TTypeTraitsExpected<float*> {
     struct TTypeTraitsExpected<float&>: public TTypeTraitsExpected<float*> {
         enum { IsPointer = false };
         enum { IsPointer = false };
         enum { IsReference = true };
         enum { IsReference = true };
-        enum { IsLvalueReference = true };
+        enum { IsLvalueReference = true }; 
     };
     };
 
 
     template <>
     template <>
     struct TTypeTraitsExpected<float&&>: public TTypeTraitsExpected<float*> {
     struct TTypeTraitsExpected<float&&>: public TTypeTraitsExpected<float*> {
-        enum { IsPointer = false };
-        enum { IsReference = true };
-        enum { IsRvalueReference = true };
-    };
-
-    template <>
+        enum { IsPointer = false }; 
+        enum { IsReference = true }; 
+        enum { IsRvalueReference = true }; 
+    }; 
+ 
+    template <> 
     struct TTypeTraitsExpected<const float&>: public TTypeTraitsExpected<float&> {
     struct TTypeTraitsExpected<const float&>: public TTypeTraitsExpected<float&> {
     };
     };
 
 

+ 9 - 9
util/generic/vector.h

@@ -71,12 +71,12 @@ public:
         : TBase(src)
         : TBase(src)
     {
     {
     }
     }
-
+ 
     inline TVector(TSelf&& src) noexcept
     inline TVector(TSelf&& src) noexcept
         : TBase(std::forward<TSelf>(src))
         : TBase(std::forward<TSelf>(src))
-    {
-    }
-
+    { 
+    } 
+ 
     template <class TIter>
     template <class TIter>
     inline TVector(TIter first, TIter last)
     inline TVector(TIter first, TIter last)
         : TBase(first, last)
         : TBase(first, last)
@@ -87,12 +87,12 @@ public:
         TBase::operator=(src);
         TBase::operator=(src);
         return *this;
         return *this;
     }
     }
-
-    inline TSelf& operator=(TSelf&& src) noexcept {
+ 
+    inline TSelf& operator=(TSelf&& src) noexcept { 
         TBase::operator=(std::forward<TSelf>(src));
         TBase::operator=(std::forward<TSelf>(src));
-        return *this;
-    }
-
+        return *this; 
+    } 
+ 
     inline TSelf& operator=(std::initializer_list<T> il) {
     inline TSelf& operator=(std::initializer_list<T> il) {
         this->assign(il.begin(), il.end());
         this->assign(il.begin(), il.end());
         return *this;
         return *this;

+ 10 - 10
util/generic/vector_ut.cpp

@@ -35,39 +35,39 @@ class TYVectorTest: public TTestBase {
 private:
 private:
     void TestConstructorsAndAssignments() {
     void TestConstructorsAndAssignments() {
         using container = TVector<int>;
         using container = TVector<int>;
-
+ 
         container c1;
         container c1;
         c1.push_back(100);
         c1.push_back(100);
         c1.push_back(200);
         c1.push_back(200);
-
+ 
         container c2(c1);
         container c2(c1);
-
+ 
         UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
         UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
         UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0));
         UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0));
         UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1));
         UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1));
-
+ 
         container c3(std::move(c1));
         container c3(std::move(c1));
-
+ 
         UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
         UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
         UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0));
         UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0));
-
+ 
         c2.push_back(300);
         c2.push_back(300);
         c3 = c2;
         c3 = c2;
-
+ 
         UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2));
         UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2));
-
+ 
         c2.push_back(400);
         c2.push_back(400);
         c3 = std::move(c2);
         c3 = std::move(c2);
-
+ 
         UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
         UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
         UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3));
         UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3));
     }
     }
-
+ 
     inline void TestTildeEmptyToNull() {
     inline void TestTildeEmptyToNull() {
         TVector<int> v;
         TVector<int> v;
         UNIT_ASSERT_EQUAL(nullptr, v.data());
         UNIT_ASSERT_EQUAL(nullptr, v.data());