From 553e23a51d55a033b3979f51aae71f3a58af3d3f Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Mon, 15 Oct 2018 15:56:41 +0200
Subject: [PATCH] Add default constructor

---
 src/utils/CastArray.hpp | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/utils/CastArray.hpp b/src/utils/CastArray.hpp
index 0f9ec5145..9135489e6 100644
--- a/src/utils/CastArray.hpp
+++ b/src/utils/CastArray.hpp
@@ -7,6 +7,8 @@ template <typename DataType,
           typename CastDataType>
 class CastArray
 {
+ public:
+  using data_type = CastDataType;
  private:
   const Array<DataType> m_array;
   const size_t m_size;
@@ -26,6 +28,20 @@ class CastArray
     return m_values[i];
   }
 
+  PASTIS_INLINE
+  CastArray& operator=(const CastArray&) = default;
+
+  PASTIS_INLINE
+  CastArray& operator=(CastArray&&) = default;
+
+  PASTIS_INLINE
+  CastArray()
+      : m_size(0),
+        m_values(nullptr)
+  {
+    ;
+  }
+
   PASTIS_INLINE
   CastArray(const Array<DataType>& array)
       : m_array (array),
@@ -47,12 +63,6 @@ class CastArray
   PASTIS_INLINE
   CastArray(CastArray&&) = default;
 
-  PASTIS_INLINE
-  CastArray& operator=(const CastArray&) = default;
-
-  PASTIS_INLINE
-  CastArray& operator=(CastArray&&) = default;
-
   PASTIS_INLINE
   ~CastArray() = default;
 };
-- 
GitLab