Enable assert always in Dali::Vector
[platform/core/uifw/dali-core.git] / dali / public-api / common / dali-vector.h
index 5a61b64..fd4565e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_VECTOR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/common/type-traits.h>
 #include <dali/public-api/math/math-utils.h>
 
-/**
- * @brief For DALi internal use, asserts are enabled in debug builds.
- *
- * For Application use, asserts can be enabled manually.
- * @SINCE_1_0.0
- */
-#if defined(DEBUG_ENABLED)
-#define ENABLE_VECTOR_ASSERTS
-#endif
-
-#if defined(ENABLE_VECTOR_ASSERTS)
 #define DALI_ASSERT_VECTOR(cond) DALI_ASSERT_ALWAYS(cond)
-#else
-#define DALI_ASSERT_VECTOR(cond)
-#endif
 
 namespace Dali
 {
@@ -234,17 +220,13 @@ protected: // API for deriving classes
    * @brief Empty constructor.
    * @SINCE_1_0.0
    */
-  VectorAlgorithms()
-  {
-  }
+  VectorAlgorithms() = default;
 
   /**
    * @brief Empty destructor.
    * @SINCE_1_0.0
    */
-  ~VectorAlgorithms()
-  {
-  }
+  ~VectorAlgorithms() = default;
 
   /**
    * @brief Copy vector contents.
@@ -392,12 +374,8 @@ template<>
 class VectorAlgorithms<false> : public VectorBase
 {
 private:
-  VectorAlgorithms()
-  {
-  }
-  ~VectorAlgorithms()
-  {
-  }
+  VectorAlgorithms()  = default;
+  ~VectorAlgorithms() = default;
 };
 /// @endcond
 
@@ -433,9 +411,7 @@ public: // API
    * @brief Default constructor. Does not allocate any space.
    * @SINCE_1_0.0
    */
-  Vector()
-  {
-  }
+  Vector() = default;
 
   /**
    * @brief Destructor. Releases the allocated space.
@@ -853,11 +829,11 @@ public: // API
  * @param[in] vector The vector
  * @param[in] value The value to be removed.
  */
-template <class T, class U>
+template<class T, class U>
 inline void Erase(Dali::Vector<T>& vector, const U& value)
 {
   auto begin = vector.Begin();
-  auto end = vector.End();
+  auto end   = vector.End();
 
   vector.Erase(std::remove(begin, end, value), end);
 }
@@ -869,11 +845,11 @@ inline void Erase(Dali::Vector<T>& vector, const U& value)
  * @param[in] vector The vector
  * @param[in] predicate The predicate
  */
-template <class T, class Predicate>
+template<class T, class Predicate>
 inline void EraseIf(Dali::Vector<T>& vector, Predicate predicate)
 {
   auto begin = vector.Begin();
-  auto end = vector.End();
+  auto end   = vector.End();
 
   vector.Erase(std::remove_if(begin, end, predicate), end);
 }