aboutsummaryrefslogtreecommitdiff
path: root/include/openvic-dataloader/detail/Constexprs.hpp
blob: ade1bfa8073497b5e9351ab68d0a0f75de2391d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

// THANK YOU APPLE FOR YOUR UTTER DISREGARD FOR C++20

#if defined(__cpp_lib_optional) && __cpp_lib_optional >= 202106L
#define OVDL_OPTIONAL_CONSTEXPR constexpr
#else
#define OVDL_OPTIONAL_CONSTEXPR inline
#endif

#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
#define OVDL_STRING_CONSTEXPR constexpr
#else
#define OVDL_STRING_CONSTEXPR inline
#endif

#if defined(__cpp_lib_optional) && __cpp_lib_optional >= 202106L && defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
#define OVDL_STR_OPT_CONSTEXPR constexpr
#else
#define OVDL_STR_OPT_CONSTEXPR inline
#endif

#if defined(__cpp_lib_constexpr_vector) && __cpp_lib_constexpr_vector >= 201907L
#define OVDL_VECTOR_CONSTEXPR constexpr
#else
#define OVDL_VECTOR_CONSTEXPR inline
#endif