container_recursive_inspector.hpp
Go to the documentation of this file.
1 // Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
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 _FASTCDR_DETAIL_CONTAINERRECURSIVEINSPECTOR_HPP_
16 #define _FASTCDR_DETAIL_CONTAINERRECURSIVEINSPECTOR_HPP_
17 
18 #include <array>
19 #include <cstddef>
20 #include <type_traits>
21 
22 namespace eprosima {
23 namespace fastcdr {
24 
25 // Helpers to deduce multi-array of primitives.
27 constexpr bool is_multi_array_primitive(
28  ...)
29 {
30  return false;
31 }
32 
34 template <typename _T,
35  typename std::enable_if<std::is_enum<_T>::value ||
36  std::is_arithmetic<_T>::value>::type* = nullptr>
37 constexpr bool is_multi_array_primitive(
38  _T const*)
39 {
40  return true;
41 }
42 
43 template <typename _T, size_t _N>
44 constexpr bool is_multi_array_primitive(
45  std::array<_T, _N> const*)
46 {
47  return is_multi_array_primitive(static_cast<_T const*>(nullptr));
48 }
49 
50 } // namespace fastcdr
51 } // namespace eprosima
52 
53 #endif // _FASTCDR_DETAIL_CONTAINERRECURSIVEINSPECTOR_HPP_
eprosima::fastcdr::is_multi_array_primitive
constexpr bool is_multi_array_primitive(...)
Basis.
Definition: container_recursive_inspector.hpp:27
eprosima
Definition: fixed_size_string.hpp:32


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:43