ae2f_docs
Loading...
Searching...
No Matches
Constexpr.h
1/**
2 * @file consteval.hpp
3 * @author ae2f
4 * @brief
5 * @date 2025-02-01
6 *
7 * @copyright Copyright (c) 2025
8 *
9 */
10#ifndef ae2f_Cast_consteval_hpp
11#define ae2f_Cast_consteval_hpp
12#include "../LangVer.h"
13
14
15#if __ae2f_stdcheck_CC(201703L)
16#define ae2f_if_constexpr if constexpr
17#else
18#define ae2f_if_constexpr if
19#endif
20
21#if __ae2f_stdcheck_CC(202002L)
22#define ae2f_if_consteval if consteval
23#else
24#define ae2f_if_consteval if (0)
25#endif
26
27#if __ae2f_stdcheck_CC(202002L)
28#define ae2f_constexprvirtual constexpr virtual
29#define ae2f_constinit constinit
30#else
31#define ae2f_constexprvirtual virtual
32#define ae2f_constinit /* not available */
33#endif /* C++20 */
34
35#if __ae2f_stdcheck_CC(201402L)
36#define ae2f_constextendedfun constexpr
37#define ae2f_constextendedeval constexpr
38
39#define ae2f_constextendedmethod constexpr
40#define ae2f_constextendedmethodeval constexpr
41
42#else
43#define ae2f_constextendedfun inline
44#define ae2f_constextendedmethod inline
45
46#define ae2f_constextendedeval inline
47#define ae2f_constextendedmethodeval inline
48#endif /* C++14 */
49
50#if __ae2f_stdcheck_CC(201103L)
51#define ae2f_constexprmethod constexpr
52#define ae2f_constexprfun constexpr
53#define ae2f_constevalmethod constexpr
54#define ae2f_virtual virtual
55#else
56#define ae2f_constexprmethod inline
57#define ae2f_constexprfun inline
58#define ae2f_constevalmethod inline
59#define ae2f_virtual
60
61#if !defined(__cplusplus) /* C */
62
63#if !defined(__cplusplus) && __ae2f_lvcheck_c(2023)
64/** cosntexpr variable */
65#define ae2f_constexpr constexpr
66#else
67#define ae2f_constexpr
68#endif /* C23 */
69
70
71#endif /* C */
72
73#endif /* C++11 */
74
75#if __ae2f_stdcheck_CC(202002L)
76#undef ae2f_constevalmethod
77#define ae2f_constevalmethod consteval /* C++20 */
78#define ae2f_consteval consteval
79#elif __ae2f_stdcheck_CC(0)
80
81
82/** @brief C++ keyword for const-time functions */
83#define ae2f_consteval
84
85#undef ae2f_constevalmethod
86#define ae2f_constevalmethod ae2f_constexprmethod
87
88#else
89
90#define ae2f_consteval
91#endif /* C++20 */
92
93#if !__ae2f_stdcheck_CC(201103L)
94
95#undef ae2f_noexcept
96/** @brief There will be no exception thrown */
97#define ae2f_noexcept
98#undef ae2f_constexpr
99#define ae2f_constexpr
100#else
101#undef ae2f_noexcept
102#define ae2f_noexcept noexcept
103#undef ae2f_constexpr
104#define ae2f_constexpr constexpr
105#endif /* C++<=11 */
106
107#ifdef __cplusplus
108#else
109#undef ae2f_noexcept
110#define ae2f_noexcept
111#endif
112
113#endif
#define ae2f_constexprmethod
Definition Constexpr.h:56
#define ae2f_WhenCXX(a)
Appears when the current language is C.
Definition Cxx.h:44
#define ae2f_is_cxx
Definition Cxx.h:48
#define ae2f_WhenC(a)
Appears when the current language is C++.
Definition Cxx.h:38
#define ae2f_NONE
Definition Guide.h:11
#define ae2f_stdcc_v
Standard C++ version. .
Definition LangVer.h:34
#define __ae2f_stdcheck_CC(v)
Definition LangVer.h:50
#define ae2f_PackCount
Definition Num.auto.h:6