File indexing completed on 2024-12-29 04:50:01
0001 /* 0002 SPDX-FileCopyrightText: 2018-2023 Volker Krause <vkrause@kde.org> 0003 SPDX-License-Identifier: LGPL-2.0-or-later 0004 */ 0005 0006 #ifndef KITINERARY_INTERNAL_PARAMETER_TYPE_H 0007 #define KITINERARY_INTERNAL_PARAMETER_TYPE_H 0008 0009 #include <type_traits> 0010 0011 namespace KItinerary { 0012 namespace detail { 0013 0014 /** Meta-function to select the right way to pass a parameter of type @tparam T. 0015 * @internal 0016 */ 0017 template <typename T> 0018 struct parameter_type 0019 { 0020 using type = typename std::conditional<std::is_fundamental<T>::value, T, const T&>::type; 0021 }; 0022 0023 } 0024 } 0025 0026 #endif