From 0c8c2984508caf4698d7460c554758c99c7a47cf Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 22 Feb 2018 12:40:48 +0100 Subject: [PATCH] declare by std::type_index (instead of std::type_info) --- core/include/moveit/task_constructor/properties.h | 2 +- core/src/properties.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/include/moveit/task_constructor/properties.h b/core/include/moveit/task_constructor/properties.h index 43bda906..05861050 100644 --- a/core/include/moveit/task_constructor/properties.h +++ b/core/include/moveit/task_constructor/properties.h @@ -182,7 +182,7 @@ class PropertyMap typedef std::map::const_iterator const_iterator; /// implementation of declare methods - Property& declare(const std::string& name, const std::type_info& type, + Property& declare(const std::string& name, const std::type_index& type_index, const std::string& description, const boost::any& default_value, const Property::SerializeFunction &serialize); diff --git a/core/src/properties.cpp b/core/src/properties.cpp index 02376ac7..e619692b 100644 --- a/core/src/properties.cpp +++ b/core/src/properties.cpp @@ -107,13 +107,13 @@ void Property::performInitFrom(SourceId source, const PropertyMap &other) } -Property& PropertyMap::declare(const std::string &name, const std::type_info &type, +Property& PropertyMap::declare(const std::string &name, const std::type_index &type_index, const std::string &description, const boost::any &default_value, const Property::SerializeFunction &serialize) { - auto it_inserted = props_.insert(std::make_pair(name, Property(std::type_index(type), description, default_value, serialize))); - if (!it_inserted.second && std::type_index(type) != it_inserted.first->second.type_index_) - throw Property::type_error(std::type_index(type).name(), it_inserted.first->second.type_index_.name()); + auto it_inserted = props_.insert(std::make_pair(name, Property(type_index, description, default_value, serialize))); + if (!it_inserted.second && type_index != it_inserted.first->second.type_index_) + throw Property::type_error(type_index.name(), it_inserted.first->second.type_index_.name()); return it_inserted.first->second; }