ROS 2 rclcpp + rcl - kilted  kilted
ROS 2 C++ Client Library with ROS Client Library
template_unique.hpp
1 // Copyright 2022 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 
15 #ifndef RCLCPP__DETAIL__TEMPLATE_UNIQUE_HPP_
16 #define RCLCPP__DETAIL__TEMPLATE_UNIQUE_HPP_
17 
18 #include <type_traits>
19 
20 #include "rclcpp/detail/template_contains.hpp"
21 
22 namespace rclcpp
23 {
24 namespace detail
25 {
26 
28 template<typename ... Ts>
30 
31 template<typename ... Args>
32 inline constexpr bool template_unique_v = template_unique<Args ...>::value;
33 
34 template<typename NextT, typename ... Ts>
35 struct template_unique<NextT, Ts ...>
36 {
37  enum { value = !template_contains_v<NextT, Ts ...>&& template_unique_v<Ts ...>};
38 };
39 
40 template<typename T>
41 struct template_unique<T>
42 {
43  enum { value = true };
44 };
45 
46 } // namespace detail
47 } // namespace rclcpp
48 
49 #endif // RCLCPP__DETAIL__TEMPLATE_UNIQUE_HPP_
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
Template meta-function that checks if a given list Ts contains unique types.