Commit 6e325959 for tesseract

commit 6e3259593a62bf8f12153745663541931c51ee22
Author: Egor Pugin <egor.pugin@gmail.com>
Date:   Wed Apr 7 00:29:07 2021 +0300

    Reorder list templates.

diff --git a/src/ccutil/list.h b/src/ccutil/list.h
index ac773c75..63145210 100644
--- a/src/ccutil/list.h
+++ b/src/ccutil/list.h
@@ -18,6 +18,27 @@

 namespace tesseract {

+template <typename CONTAINER, typename CLASSNAME>
+class X_ITER : public CONTAINER {
+public:
+  X_ITER() = default;
+  template <typename U>
+  X_ITER(U *list) : CONTAINER(list) {}
+
+  CLASSNAME *data() {
+    return static_cast<CLASSNAME *>(CONTAINER::data());
+  }
+  CLASSNAME *data_relative(int8_t offset) {
+    return static_cast<CLASSNAME *>(CONTAINER::data_relative(offset));
+  }
+  CLASSNAME *forward() {
+    return static_cast<CLASSNAME *>(CONTAINER::forward());
+  }
+  CLASSNAME *extract() {
+    return static_cast<CLASSNAME *>(CONTAINER::extract());
+  }
+};
+
 template <typename CONTAINER, typename ITERATOR_TYPE, typename CLASSNAME>
 class X_LIST : public CONTAINER {
 public:
@@ -36,8 +57,6 @@ public:
   /* Become a deep copy of src_list */
   template <typename U>
   void deep_copy(const U *src_list, CLASSNAME *(*copier)(const CLASSNAME *)) {
-    static_assert(std::is_base_of_v<X_LIST, U>);
-
     X_ITER<ITERATOR_TYPE, CLASSNAME> from_it(const_cast<U *>(src_list));
     X_ITER<ITERATOR_TYPE, CLASSNAME> to_it(this);

@@ -46,27 +65,6 @@ public:
   }
 };

-template <typename CONTAINER, typename CLASSNAME>
-class X_ITER : public CONTAINER {
-public:
-  X_ITER() = default;
-  template <typename U>
-  X_ITER(U *list) : CONTAINER(list) {}
-
-  CLASSNAME *data() {
-    return static_cast<CLASSNAME *>(CONTAINER::data());
-  }
-  CLASSNAME *data_relative(int8_t offset) {
-    return static_cast<CLASSNAME *>(CONTAINER::data_relative(offset));
-  }
-  CLASSNAME *forward() {
-    return static_cast<CLASSNAME *>(CONTAINER::forward());
-  }
-  CLASSNAME *extract() {
-    return static_cast<CLASSNAME *>(CONTAINER::extract());
-  }
-};
-
 } // namespace tesseract

 #endif