[neurun] Introduce default constructor for Index (#2831)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Fri, 28 Sep 2018 04:07:46 +0000 (13:07 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Fri, 28 Sep 2018 04:07:46 +0000 (13:07 +0900)
Introduce default constructor for `Graph::Index` so wrapping objects can
have a default constructor.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/graph/Index.h

index 864aaff..3263d12 100644 (file)
@@ -18,6 +18,7 @@
 #define __NEURUN_GRAPH_INDEX_H__
 
 #include <functional>
+#include <limits>
 #include <stdint.h>
 
 namespace neurun
@@ -27,7 +28,11 @@ namespace graph
 
 template <typename T, typename DummyTag> class Index
 {
+private:
+  static const T UNDEFINED = std::numeric_limits<T>::max();
+
 public:
+  explicit Index(void) : _index{UNDEFINED} {}
   explicit Index(T o) : _index{o} {}
   explicit Index(int32_t o) : _index{static_cast<T>(o)} {} // For legacy code compatibility
   Index(const Index &o) : _index{o._index} {}