@@ -78,7 +78,7 @@ template <auto I> using constant = std::integral_constant<decltype(I), I>;
78
78
template <auto I> constexpr static constant<I> _c{};
79
79
80
80
inline namespace literals {
81
- template <char ... Chars> CONSTEVAL auto operator " " _c() {
81
+ template <char ... Chars> CONSTEVAL_UDL auto operator " " _c() {
82
82
return _c<parse_literal<std::uint32_t , Chars...>()>;
83
83
}
84
84
} // namespace literals
@@ -89,58 +89,60 @@ enum struct length_t : std::uint32_t {};
89
89
90
90
inline namespace literals {
91
91
// NOLINTBEGIN(google-runtime-int)
92
- CONSTEVAL auto operator " " _lsb(unsigned long long int n) -> lsb_t {
92
+ CONSTEVAL_UDL auto operator " " _lsb(unsigned long long int n) -> lsb_t {
93
93
return static_cast <lsb_t >(n);
94
94
}
95
- CONSTEVAL auto operator " " _msb(unsigned long long int n) -> msb_t {
95
+ CONSTEVAL_UDL auto operator " " _msb(unsigned long long int n) -> msb_t {
96
96
return static_cast <msb_t >(n);
97
97
}
98
- CONSTEVAL auto operator " " _len(unsigned long long int n) -> length_t {
98
+ CONSTEVAL_UDL auto operator " " _len(unsigned long long int n) -> length_t {
99
99
return static_cast <length_t >(n);
100
100
}
101
101
// NOLINTEND(google-runtime-int)
102
102
} // namespace literals
103
103
104
104
inline namespace literals {
105
- CONSTEVAL auto operator " " _b(char const *, std::size_t ) -> bool { return true ; }
106
- CONSTEVAL auto operator " " _true(char const *, std::size_t ) -> bool {
105
+ CONSTEVAL_UDL auto operator " " _b(char const *, std::size_t ) -> bool {
107
106
return true ;
108
107
}
109
- CONSTEVAL auto operator " " _false(char const *, std::size_t ) -> bool {
108
+ CONSTEVAL_UDL auto operator " " _true(char const *, std::size_t ) -> bool {
109
+ return true ;
110
+ }
111
+ CONSTEVAL_UDL auto operator " " _false(char const *, std::size_t ) -> bool {
110
112
return false ;
111
113
}
112
114
113
115
// NOLINTBEGIN(google-runtime-int)
114
- CONSTEVAL auto operator " " _k(unsigned long long int n)
116
+ CONSTEVAL_UDL auto operator " " _k(unsigned long long int n)
115
117
-> unsigned long long int {
116
118
return n * 1'000u ;
117
119
}
118
- CONSTEVAL auto operator " " _M(unsigned long long int n)
120
+ CONSTEVAL_UDL auto operator " " _M(unsigned long long int n)
119
121
-> unsigned long long int {
120
122
return n * 1'000'000u ;
121
123
}
122
- CONSTEVAL auto operator " " _G(unsigned long long int n)
124
+ CONSTEVAL_UDL auto operator " " _G(unsigned long long int n)
123
125
-> unsigned long long int {
124
126
return n * 1'000'000'000u ;
125
127
}
126
128
127
- CONSTEVAL auto operator " " _ki(unsigned long long int n)
129
+ CONSTEVAL_UDL auto operator " " _ki(unsigned long long int n)
128
130
-> unsigned long long int {
129
131
return n * 1'024u ;
130
132
}
131
- CONSTEVAL auto operator " " _Mi(unsigned long long int n)
133
+ CONSTEVAL_UDL auto operator " " _Mi(unsigned long long int n)
132
134
-> unsigned long long int {
133
135
return n * 1'024ull * 1'024ull ;
134
136
}
135
- CONSTEVAL auto operator " " _Gi(unsigned long long int n)
137
+ CONSTEVAL_UDL auto operator " " _Gi(unsigned long long int n)
136
138
-> unsigned long long int {
137
139
return n * 1'024ull * 1'024ull * 1'024ull ;
138
140
}
139
141
140
142
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
141
143
142
144
#define STDX_SMALL_INT_LITERAL_DEF (x ) \
143
- CONSTEVAL auto operator " " _##x(char const *, std::size_t ) \
145
+ CONSTEVAL_UDL auto operator " " _##x(char const *, std::size_t ) \
144
146
->std::integral_constant<std::size_t , x##u> { \
145
147
return {}; \
146
148
}
0 commit comments