AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
type_traits.h
1#ifndef PROBFD_CALL_TRAITS_H
2#define PROBFD_CALL_TRAITS_H
3
4#include <type_traits>
5
6// Forward Declarations
7class OperatorID;
8
9namespace probfd {
10
11template <typename T>
12struct is_cheap_to_copy : public std::bool_constant<std::is_scalar_v<T>> {};
13
14template <>
15struct is_cheap_to_copy<OperatorID> : public std::true_type {};
16
17template <typename T>
18static constexpr bool is_cheap_to_copy_v = is_cheap_to_copy<T>::value;
19
24template <typename T>
26 typename std::conditional_t<is_cheap_to_copy_v<T>, T, const T&>;
27
28} // namespace probfd
29
30#endif // PROBFD_CALL_TRAITS_H
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
typename std::conditional_t< is_cheap_to_copy_v< T >, T, const T & > param_type
Alias template defining the best way to pass a parameter of a given type.
Definition type_traits.h:25