From e30bf725b1ce6b6967ada84a3dfc1e0c65ae9a7f Mon Sep 17 00:00:00 2001 From: Pierre Gergondet <pierre.gergondet@gmail.com> Date: Wed, 23 Jul 2014 17:29:08 +0900 Subject: [PATCH] Move definition of template instatiation to cpp --- include/dynamic-graph/value.h | 16 ++++++++-------- src/command/value.cpp | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/dynamic-graph/value.h b/include/dynamic-graph/value.h index 8e9bd1a..1b42a54 100644 --- a/include/dynamic-graph/value.h +++ b/include/dynamic-graph/value.h @@ -115,14 +115,14 @@ namespace dynamicgraph { static const Value::Type TypeID; }; - template<> const Value::Type ValueHelper<bool>::TypeID = Value::BOOL; - template<> const Value::Type ValueHelper<unsigned>::TypeID = Value::UNSIGNED; - template<> const Value::Type ValueHelper<int>::TypeID = Value::INT; - template<> const Value::Type ValueHelper<float>::TypeID = Value::FLOAT; - template<> const Value::Type ValueHelper<double>::TypeID = Value::DOUBLE; - template<> const Value::Type ValueHelper<std::string>::TypeID = Value::STRING; - template<> const Value::Type ValueHelper<Vector>::TypeID = Value::VECTOR; - template<> const Value::Type ValueHelper<Matrix>::TypeID = Value::MATRIX; + template<> const Value::Type ValueHelper<bool>::TypeID; + template<> const Value::Type ValueHelper<unsigned>::TypeID; + template<> const Value::Type ValueHelper<int>::TypeID; + template<> const Value::Type ValueHelper<float>::TypeID; + template<> const Value::Type ValueHelper<double>::TypeID; + template<> const Value::Type ValueHelper<std::string>::TypeID; + template<> const Value::Type ValueHelper<Vector>::TypeID; + template<> const Value::Type ValueHelper<Matrix>::TypeID; } // namespace command } //namespace dynamicgraph diff --git a/src/command/value.cpp b/src/command/value.cpp index ee8cd41..92a032d 100644 --- a/src/command/value.cpp +++ b/src/command/value.cpp @@ -330,5 +330,14 @@ namespace dynamicgraph { return os; } + template<> const Value::Type ValueHelper<bool>::TypeID = Value::BOOL; + template<> const Value::Type ValueHelper<unsigned>::TypeID = Value::UNSIGNED; + template<> const Value::Type ValueHelper<int>::TypeID = Value::INT; + template<> const Value::Type ValueHelper<float>::TypeID = Value::FLOAT; + template<> const Value::Type ValueHelper<double>::TypeID = Value::DOUBLE; + template<> const Value::Type ValueHelper<std::string>::TypeID = Value::STRING; + template<> const Value::Type ValueHelper<Vector>::TypeID = Value::VECTOR; + template<> const Value::Type ValueHelper<Matrix>::TypeID = Value::MATRIX; + } // namespace command } //namespace dynamicgraph -- GitLab