iceoryx_hoofs  2.0.2
algorithm.hpp
1 // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 #ifndef IOX_HOOFS_CXX_ALGORITHM_HPP
18 #define IOX_HOOFS_CXX_ALGORITHM_HPP
19 
20 #include <cstdint>
21 #include <type_traits>
22 
23 namespace iox
24 {
25 namespace algorithm
26 {
33 template <typename T>
34 constexpr T max(const T& left) noexcept;
35 
43 template <typename T>
44 constexpr T max(const T& left, const T& right) noexcept;
45 
53 template <typename T, typename... Targs>
54 constexpr T max(const T& left, const T& right, const Targs&... args) noexcept;
55 
62 template <typename T>
63 constexpr T min(const T& left) noexcept;
64 
72 template <typename T>
73 constexpr T min(const T& left, const T& right) noexcept;
74 
82 template <typename T, typename... Targs>
83 constexpr T min(const T& left, const T& right, const Targs&... args) noexcept;
84 
89 template <typename T, typename CompareType>
90 constexpr bool doesContainType() noexcept;
91 
96 template <typename T, typename CompareType, typename Next, typename... Remainder>
97 constexpr bool doesContainType() noexcept;
98 
102 template <typename T>
103 inline constexpr bool doesContainValue(const T) noexcept;
104 
111 template <typename T, typename... ValueList>
112 inline constexpr bool
113 doesContainValue(const T value, const T firstValueListEntry, const ValueList... remainingValueListEntries) noexcept;
114 
121 template <typename Container>
122 Container uniqueMergeSortedContainers(const Container& v1, const Container& v2) noexcept;
123 } // namespace algorithm
124 } // namespace iox
125 
126 #include "iceoryx_hoofs/internal/cxx/algorithm.inl"
127 
128 #endif // IOX_HOOFS_CXX_ALGORITHM_HPP
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:29