Add internal tag to VectorAlgorithms
[platform/core/uifw/dali-core.git] / dali / public-api / common / compile-time-assert.h
index a9fd91c..7fd4098 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_COMPILE_TIME_ASSERT_H__
-#define __DALI_COMPILE_TIME_ASSERT_H__
+#ifndef DALI_COMPILE_TIME_ASSERT_H
+#define DALI_COMPILE_TIME_ASSERT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -31,22 +31,16 @@ namespace Dali
  * @{
  */
 
-template <bool x> struct CompileTimeAssertBool;    ///< Bool Template to test condition
-template <> struct CompileTimeAssertBool<true> {}; ///< Specialize for true, but not for false @SINCE_1_0.0
-
-template<int x> struct CompileTimeAssertInt {};    ///< Template to wrap conditional template CompileTimeAsserBool @SINCE_1_0.0
-
 /**
  * @brief Use DALI_COMPILE_TIME_ASSERT to test expressions at compile time.
  *
- * If x is false, then 'sizeof' will be attempted with incomplete type.
  * @SINCE_1_0.0
  */
-#define DALI_COMPILE_TIME_ASSERT( x ) typedef CompileTimeAssertInt< sizeof( CompileTimeAssertBool< ( x ) > ) > CompileTimeAssertType __attribute__((__unused__))
+#define DALI_COMPILE_TIME_ASSERT( x ) static_assert( x, #x );
 
 /**
  * @}
  */
 } // namespace Dali
 
-#endif // __DALI_COMPILE_TIME_ASSERT_H__
+#endif // DALI_COMPILE_TIME_ASSERT_H