Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ab3895

Browse files
Merge pull request BehaviorTree#139 from scgroot/master
Fixed compiling for c++17
2 parents 2a859e6 + cb0ebe1 commit 0ab3895

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

include/behaviortree_cpp_v3/basic_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ std::pair<std::string,PortInfo> CreatePort(PortDirection direction,
256256

257257
if( std::is_same<T, void>::value)
258258
{
259-
out = {name.to_string(), PortInfo(direction) };
259+
out = {nonstd::to_string(name), PortInfo(direction) };
260260
}
261261
else{
262-
out = {name.to_string(), PortInfo(direction, typeid(T),
262+
out = {nonstd::to_string(name), PortInfo(direction, typeid(T),
263263
GetAnyFromStringFunctor<T>() ) };
264264
}
265265
if( !description.empty() )

include/behaviortree_cpp_v3/exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class BehaviorTreeException : public std::exception
2424
{
2525
public:
2626

27-
BehaviorTreeException(nonstd::string_view message): message_(message.to_string())
27+
BehaviorTreeException(nonstd::string_view message): message_(nonstd::to_string(message))
2828
{}
2929

3030
template <typename... SV>

include/behaviortree_cpp_v3/tree_node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ inline Result TreeNode::getInput(const std::string& key, T& destination) const
208208
"but BB is invalid");
209209
}
210210

211-
const Any* val = config_.blackboard->getAny(remapped_key.to_string());
211+
const Any* val = config_.blackboard->getAny(nonstd::to_string(remapped_key));
212212
if (val && val->empty() == false)
213213
{
214214
if (std::is_same<T, std::string>::value == false && val->type() == typeid(std::string))
@@ -258,7 +258,7 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)
258258
{
259259
remapped_key = stripBlackboardPointer(remapped_key);
260260
}
261-
const auto& key_str = remapped_key.to_string();
261+
const auto& key_str = nonstd::to_string(remapped_key);
262262

263263
config_.blackboard->set(key_str, value);
264264

src/basic_types.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ std::string convertFromString<std::string>(StringView str)
103103
template <>
104104
const char* convertFromString<const char*>(StringView str)
105105
{
106-
return str.to_string().c_str();
106+
return nonstd::to_string(str).c_str();
107107
}
108108

109109
template <>
@@ -197,7 +197,7 @@ NodeStatus convertFromString<NodeStatus>(StringView str)
197197
if( str == "RUNNING" ) return NodeStatus::RUNNING;
198198
if( str == "SUCCESS" ) return NodeStatus::SUCCESS;
199199
if( str == "FAILURE" ) return NodeStatus::FAILURE;
200-
throw RuntimeError(std::string("Cannot convert this to NodeStatus: ") + str.to_string() );
200+
throw RuntimeError(std::string("Cannot convert this to NodeStatus: ") + nonstd::to_string(str) );
201201
}
202202

203203
template <>
@@ -288,12 +288,12 @@ Any PortInfo::parseString(const std::string &str) const
288288

289289
void PortInfo::setDescription(StringView description)
290290
{
291-
description_ = description.to_string();
291+
description_ = nonstd::to_string(description);
292292
}
293293

294294
void PortInfo::setDefaultValue(StringView default_value_as_string)
295295
{
296-
default_value_ = default_value_as_string.to_string();
296+
default_value_ = nonstd::to_string(default_value_as_string);
297297
}
298298

299299
const std::string &PortInfo::description() const

src/xml_parsing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ TreeNode::Ptr XMLParser::Pimpl::createNodeFromXML(const XMLElement *element,
520520
auto remapped_res = TreeNode::getRemappedKey(port_name, remapping_value);
521521
if( remapped_res )
522522
{
523-
const auto& port_key = remapped_res.value().to_string();
523+
const auto& port_key = nonstd::to_string(remapped_res.value());
524524

525525
auto prev_info = blackboard->portInfo( port_key );
526526
if( !prev_info )

0 commit comments

Comments
 (0)