Skip to content

Commit

Permalink
fix issue microsoft#34 : if you don't implement convertFromString, it…
Browse files Browse the repository at this point in the history
… will compile but it may throw
  • Loading branch information
facontidavide committed Dec 11, 2018
1 parent a6e4534 commit 5830292
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions include/behaviortree_cpp/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,37 @@ T convertFromString(const StringView& /*str*/)
"convertFromString for this type: ") + type_name );
}

template <>
std::string convertFromString<std::string>(const StringView& str);

template <>
const char* convertFromString<const char*>(const StringView& str);

template <>
int convertFromString<int>(const StringView& str);

template <>
unsigned convertFromString<unsigned>(const StringView& str);

template <>
double convertFromString<double>(const StringView& str);

template <> // Integer numbers separated by the characted ";"
std::vector<int> convertFromString<std::vector<int>>(const StringView& str);

template <> // Real numbers separated by the characted ";"
std::vector<double> convertFromString<std::vector<double>>(const StringView& str);

template <> // This recognizes either 0/1, true/false, TRUE/FALSE
bool convertFromString<bool>(const StringView& str);

template <> // Names with all capital letters
NodeStatus convertFromString<NodeStatus>(const StringView& str);

template <> // Names with all capital letters
NodeType convertFromString<NodeType>(const StringView& str);


//------------------------------------------------------------------

/**
Expand Down

0 comments on commit 5830292

Please sign in to comment.