1+ //  Copyright 2025 Open Source Robotics Foundation, Inc.
2+ // 
3+ //  Licensed under the Apache License, Version 2.0 (the "License");
4+ //  you may not use this file except in compliance with the License.
5+ //  You may obtain a copy of the License at
6+ // 
7+ //      http://www.apache.org/licenses/LICENSE-2.0
8+ // 
9+ //  Unless required by applicable law or agreed to in writing, software
10+ //  distributed under the License is distributed on an "AS IS" BASIS,
11+ //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ //  See the License for the specific language governing permissions and
13+ //  limitations under the License.
14+ 
115#include  < gtest/gtest.h> 
216
317#include  < chrono> 
@@ -36,14 +50,14 @@ template<
3650    AllocatorT
3751  >>
3852class  CustomSubscription  : public  rclcpp ::Subscription<
39-   MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>  
53+      MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>
4054{
4155public: 
42- 
43-   template  < typename ... Args> 
44-   CustomSubscription (Args &&...args)  : rclcpp::Subscription<
45-     MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>(
46-     std::forward<Args>(args)...) {}
56+    template < typename  ... Args> 
57+   explicit   CustomSubscription (Args && ... args) 
58+   : rclcpp::Subscription<
59+        MessageT, AllocatorT, SubscribedT, ROSMessageT, MessageMemoryStrategyT>(
60+        std::forward<Args>(args)...) {}
4761};
4862
4963TEST_F (TestCreateSubscription, create) {
@@ -69,4 +83,4 @@ TEST_F(TestCreateSubscription, create) {
6983  ASSERT_NE (nullptr , subscription);
7084  EXPECT_STREQ (" /ns/topic_name" get_topic_name ());
7185  static_assert (std::is_same_v<std::decay_t <decltype (*subscription.get ())>, SubscriptionT>);
72- }
86+ }
0 commit comments