From 6eb645ed701921ca6b9d27257a789b56f737fa6e Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Tue, 26 Feb 2019 16:29:58 +0100 Subject: [PATCH] Allow toStr from string Needed for string default values --- include/behaviortree_cpp/basic_types.h | 2 ++ src/basic_types.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/behaviortree_cpp/basic_types.h b/include/behaviortree_cpp/basic_types.h index de7d34779..2b5720618 100644 --- a/include/behaviortree_cpp/basic_types.h +++ b/include/behaviortree_cpp/basic_types.h @@ -127,6 +127,8 @@ std::string toStr(T value) return std::to_string(value); } +std::string toStr(std::string value); + template<> std::string toStr(BT::NodeStatus status); /** diff --git a/src/basic_types.cpp b/src/basic_types.cpp index 9c7721ead..451e3da0f 100644 --- a/src/basic_types.cpp +++ b/src/basic_types.cpp @@ -22,6 +22,11 @@ std::string toStr(NodeStatus status) return ""; } +std::string toStr(std::string value) +{ + return value; +} + std::string toStr(NodeStatus status, bool colored) { if (!colored)