Skip to content
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

Add in a fix for older compilers. #2075

Merged
merged 2 commits into from
Jan 4, 2023
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
6 changes: 0 additions & 6 deletions rclcpp/include/rclcpp/node_interfaces/node_interfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ class NodeInterfaces
: NodeInterfacesSupportsT(node)
{}

/// NodeT::SharedPtr Constructor
template<typename NodeT>
NodeInterfaces(std::shared_ptr<NodeT> node) // NOLINT(runtime/explicit)
: NodeInterfaces(node ? *node : throw std::invalid_argument("given node pointer is nullptr"))
{}

explicit NodeInterfaces(std::shared_ptr<InterfaceTs>... args)
: NodeInterfacesSupportsT(args ...)
{}
Expand Down
12 changes: 6 additions & 6 deletions rclcpp/test/rclcpp/node_interfaces/test_node_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST_F(TestNodeInterfaces, node_interfaces_nominal) {
using rclcpp::node_interfaces::NodeInterfaces;
using rclcpp::node_interfaces::NodeBaseInterface;
using rclcpp::node_interfaces::NodeGraphInterface;
auto node_interfaces = NodeInterfaces<NodeBaseInterface, NodeGraphInterface>(node);
auto node_interfaces = NodeInterfaces<NodeBaseInterface, NodeGraphInterface>(*node);
}

// Implicit conversion of rclcpp::Node into function that uses NodeInterfaces of base.
Expand All @@ -55,7 +55,7 @@ TEST_F(TestNodeInterfaces, node_interfaces_nominal) {
auto base_interface = ni.get<NodeBaseInterface>();
};

some_func(node);
some_func(*node);
}

// Implicit narrowing of NodeInterfaces into a new interface NodeInterfaces with fewer interfaces.
Expand All @@ -67,7 +67,7 @@ TEST_F(TestNodeInterfaces, node_interfaces_nominal) {
auto base_interface = ni_with_one.get<NodeBaseInterface>();
};

NodeInterfaces<NodeBaseInterface, NodeGraphInterface> ni_with_two(node);
NodeInterfaces<NodeBaseInterface, NodeGraphInterface> ni_with_two(*node);

some_func(ni_with_two);
}
Expand Down Expand Up @@ -102,7 +102,7 @@ TEST_F(TestNodeInterfaces, node_interfaces_standard_interfaces) {
rclcpp::node_interfaces::NodeWaitablesInterface,
rclcpp::node_interfaces::NodeParametersInterface,
rclcpp::node_interfaces::NodeTimeSourceInterface
>(node);
>(*node);
}

/*
Expand Down Expand Up @@ -134,7 +134,7 @@ TEST_F(TestNodeInterfaces, ni_init) {
NodeWaitablesInterface,
NodeParametersInterface,
NodeTimeSourceInterface
>(node);
>(*node);

{
auto base = ni.get<NodeBaseInterface>();
Expand Down Expand Up @@ -198,7 +198,7 @@ TEST_F(TestNodeInterfaces, ni_all_init) {
using rclcpp::node_interfaces::NodeParametersInterface;
using rclcpp::node_interfaces::NodeTimeSourceInterface;

auto ni = rclcpp::node_interfaces::NodeInterfaces<ALL_RCLCPP_NODE_INTERFACES>(node);
auto ni = rclcpp::node_interfaces::NodeInterfaces<ALL_RCLCPP_NODE_INTERFACES>(*node);

{
auto base = ni.get<NodeBaseInterface>();
Expand Down