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

Skip to content

Fixed compiling for c++17 #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/behaviortree_cpp_v3/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ std::pair<std::string,PortInfo> CreatePort(PortDirection direction,

if( std::is_same<T, void>::value)
{
out = {name.to_string(), PortInfo(direction) };
out = {nonstd::to_string(name), PortInfo(direction) };
}
else{
out = {name.to_string(), PortInfo(direction, typeid(T),
out = {nonstd::to_string(name), PortInfo(direction, typeid(T),
GetAnyFromStringFunctor<T>() ) };
}
if( !description.empty() )
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp_v3/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BehaviorTreeException : public std::exception
{
public:

BehaviorTreeException(nonstd::string_view message): message_(message.to_string())
BehaviorTreeException(nonstd::string_view message): message_(nonstd::to_string(message))
{}

template <typename... SV>
Expand Down
4 changes: 2 additions & 2 deletions include/behaviortree_cpp_v3/tree_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ inline Result TreeNode::getInput(const std::string& key, T& destination) const
"but BB is invalid");
}

const Any* val = config_.blackboard->getAny(remapped_key.to_string());
const Any* val = config_.blackboard->getAny(nonstd::to_string(remapped_key));
if (val && val->empty() == false)
{
if (std::is_same<T, std::string>::value == false && val->type() == typeid(std::string))
Expand Down Expand Up @@ -258,7 +258,7 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)
{
remapped_key = stripBlackboardPointer(remapped_key);
}
const auto& key_str = remapped_key.to_string();
const auto& key_str = nonstd::to_string(remapped_key);

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

Expand Down
8 changes: 4 additions & 4 deletions src/basic_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ std::string convertFromString<std::string>(StringView str)
template <>
const char* convertFromString<const char*>(StringView str)
{
return str.to_string().c_str();
return nonstd::to_string(str).c_str();
}

template <>
Expand Down Expand Up @@ -197,7 +197,7 @@ NodeStatus convertFromString<NodeStatus>(StringView str)
if( str == "RUNNING" ) return NodeStatus::RUNNING;
if( str == "SUCCESS" ) return NodeStatus::SUCCESS;
if( str == "FAILURE" ) return NodeStatus::FAILURE;
throw RuntimeError(std::string("Cannot convert this to NodeStatus: ") + str.to_string() );
throw RuntimeError(std::string("Cannot convert this to NodeStatus: ") + nonstd::to_string(str) );
}

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

void PortInfo::setDescription(StringView description)
{
description_ = description.to_string();
description_ = nonstd::to_string(description);
}

void PortInfo::setDefaultValue(StringView default_value_as_string)
{
default_value_ = default_value_as_string.to_string();
default_value_ = nonstd::to_string(default_value_as_string);
}

const std::string &PortInfo::description() const
Expand Down
2 changes: 1 addition & 1 deletion src/xml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ TreeNode::Ptr XMLParser::Pimpl::createNodeFromXML(const XMLElement *element,
auto remapped_res = TreeNode::getRemappedKey(port_name, remapping_value);
if( remapped_res )
{
const auto& port_key = remapped_res.value().to_string();
const auto& port_key = nonstd::to_string(remapped_res.value());

auto prev_info = blackboard->portInfo( port_key );
if( !prev_info )
Expand Down