Skip to content

Commit def728c

Browse files
committed
fix another case of 'no appropriate default constructor available'
Signed-off-by: William Woodall <william@osrfoundation.org>
1 parent 2ecfc6e commit def728c

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,25 @@ using PublisherOptionsWithAllocator = rclcpp::PublisherOptionsWithAllocator<Allo
7575
template<typename AllocatorT>
7676
using SubscriptionOptionsWithAllocator = rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>;
7777

78+
namespace detail
79+
{
80+
81+
template<typename AllocatorT>
82+
PublisherOptionsWithAllocator<AllocatorT>
83+
create_default_publisher_options()
84+
{
85+
return rclcpp::PublisherOptionsWithAllocator<AllocatorT>();
86+
}
87+
7888
template<typename AllocatorT>
7989
SubscriptionOptionsWithAllocator<AllocatorT>
8090
create_default_subscription_options()
8191
{
8292
return rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>();
8393
}
8494

95+
} // namespace detail
96+
8597
/// LifecycleNode for creating lifecycle components
8698
/**
8799
* has lifecycle nodeinterface for configuring this node.
@@ -160,7 +172,7 @@ class LifecycleNode : public node_interfaces::LifecycleNodeInterface,
160172
const std::string & topic_name,
161173
const rclcpp::QoS & qos,
162174
const PublisherOptionsWithAllocator<AllocatorT> & options =
163-
PublisherOptionsWithAllocator<AllocatorT>()
175+
detail::create_default_publisher_options<AllocatorT>()
164176
);
165177

166178
/// Create and return a Publisher.
@@ -219,7 +231,7 @@ class LifecycleNode : public node_interfaces::LifecycleNodeInterface,
219231
const rclcpp::QoS & qos,
220232
CallbackT && callback,
221233
const SubscriptionOptionsWithAllocator<AllocatorT> & options =
222-
create_default_subscription_options<AllocatorT>(),
234+
detail::create_default_subscription_options<AllocatorT>(),
223235
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<
224236
typename rclcpp::subscription_traits::has_message_type<CallbackT>::type, AllocatorT
225237
>::SharedPtr

0 commit comments

Comments
 (0)