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

Skip to content

Commit d895042

Browse files
string_view updated
1 parent 0602fd9 commit d895042

File tree

6 files changed

+563
-338
lines changed

6 files changed

+563
-338
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 = {nonstd::to_string(name), PortInfo(direction) };
259+
out = {static_cast<std::string>(name), PortInfo(direction) };
260260
}
261261
else{
262-
out = {nonstd::to_string(name), PortInfo(direction, typeid(T),
262+
out = {static_cast<std::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_(nonstd::to_string(message))
27+
BehaviorTreeException(nonstd::string_view message): message_(static_cast<std::string>(message))
2828
{}
2929

3030
template <typename... SV>

include/behaviortree_cpp_v3/tree_node.h

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

214-
const Any* val = config_.blackboard->getAny(nonstd::to_string(remapped_key));
214+
const Any* val = config_.blackboard->getAny(static_cast<std::string>(remapped_key));
215215
if (val && val->empty() == false)
216216
{
217217
if (std::is_same<T, std::string>::value == false && val->type() == typeid(std::string))
@@ -261,9 +261,7 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)
261261
{
262262
remapped_key = stripBlackboardPointer(remapped_key);
263263
}
264-
const auto& key_str = nonstd::to_string(remapped_key);
265-
266-
config_.blackboard->set(key_str, value);
264+
config_.blackboard->set(static_cast<std::string>(remapped_key), value);
267265

268266
return {};
269267
}

0 commit comments

Comments
 (0)