YSTest: operators.hpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

operators.hpp
浏览该文件的文档.
1 /*
2 © 2011-2016, 2018 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
39 #ifndef YB_INC_ystdex_operators_hpp_
40 #define YB_INC_ystdex_operators_hpp_ 1
41
42 #include "addressof.hpp" // for "type_traits.hpp", false_, true_, _t,
43 // empty_base, ystdex::addressof;
44 #include "integer_sequence.hpp" // for index_sequence, vseq::defer_apply_t,
45 // vseq::_a, vseq::fold_t;
46
47 namespace ystdex
48 {
49
55 namespace dep_ops
56 {
57
59 using no_constfn = yimpl(false_);
61 using use_constfn = yimpl(true_);
62
63 } // namespace dep_ops;
64
65 #define YB_Impl_Operators_DeOpt class _tOpt = yimpl(use_constfn)
66 #define YB_Impl_Operators_H_n(_args) template<class _type, _args>
67 #define YB_Impl_Operators_H1 \
68 YB_Impl_Operators_H_n(YB_Impl_Operators_DeOpt)
69 #define YB_Impl_Operators_H2 \
70 YB_Impl_Operators_H_n(typename _type2 YPP_Comma YB_Impl_Operators_DeOpt)
71 #define YB_Impl_Operators_H2_de \
72 YB_Impl_Operators_H_n(typename _type2 = _type YPP_Comma \
73 YB_Impl_Operators_DeOpt)
74 #define YB_Impl_Operators_H2_Alias(_name, ...) \
75 YB_Impl_Operators_H2 \
76 yimpl(using) _name = __VA_ARGS__;
77 #define YB_Impl_Operators_H2_Alias_de(_name, ...) \
78 YB_Impl_Operators_H2_de \
79 yimpl(using) _name = __VA_ARGS__;
80 #define YB_Impl_Operators_H3 \
81 YB_Impl_Operators_H_n(typename _type2 YPP_Comma typename _type3 \
82 YPP_Comma YB_Impl_Operators_DeOpt)
83
84 namespace details
85 {
86
88
89 template<typename _type = void>
90 struct op_idt
91 {
92 using type = _type;
93 };
94
96 template<>
97 struct op_idt<void>;
98
99 template<typename _type = void>
100 using op_idt_t = _t<op_idt<_type>>;
102
103
105
106 template<class... _types>
107 struct ebases : _types...
108 {};
109
110 template<size_t _vN, class _type, typename _type2, class _tOpt>
111 struct bin_ops;
112
113 template<class, typename, class, class>
114 struct ops_seq;
115
116 template<class _type, typename _type2, class _tOpt, size_t... _vSeq>
117 struct ops_seq<_type, _type2, _tOpt, index_sequence<_vSeq...>>
118 {
119 using type = ebases<bin_ops<_vSeq, _type, _type2, _tOpt>...>;
120 };
122
123
124 #define YB_Impl_Operators_f(_c, _op, _tRet, _expr, ...) \
125 friend _c YB_ATTR(always_inline) _tRet \
126 operator _op(__VA_ARGS__) ynoexcept(noexcept(_expr)) \
127 { \
128 return (_expr); \
129 }
130 #if YB_IMPL_GNUCPP && YB_IMPL_GNUCPP < 50000
131 # define YB_Impl_Operators_bin_ts(_n, _f, _c, _opt, ...) \
132 YB_Impl_Operators_H_n(typename _type2) \
133 struct bin_ops<_n, _type, _type2, dep_ops::_opt> \
134 { \
135 _f(_c, __VA_ARGS__) \
136 };
137 #else
138 # define YB_Impl_Operators_bin_ts(_n, _f, _c, _opt, ...) \
139 YB_Impl_Operators_H_n(typename _type2) \
140 struct bin_ops<_n, _type, _type2, dep_ops::_opt> \
141 { \
142 template<yimpl(typename = void)> \
143 _f(_c, __VA_ARGS__) \
144 };
145 #endif
146 #define YB_Impl_Operators_bin_spec(_n, _f, ...) \
147 YB_Impl_Operators_bin_ts(_n, _f, inline, no_constfn, __VA_ARGS__) \
148 YB_Impl_Operators_bin_ts(_n, _f, yconstfn, use_constfn, __VA_ARGS__)
149 // NOTE: The trunk libstdc++ std::experimental::string_view comparison should
150 // depend on the same technique.
151 // TODO: See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52072. It is strange
152 // to still have this bug. Not fully tested for G++ 5. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67426.
153 #if true // YB_IMPL_GNUCPP
154 # define YB_Impl_Operators_cmpf(_c, _op, _expr, _ptp, _ptp2) \
155 YB_Impl_Operators_f(_c, _op, bool, _expr, const _ptp& x, const _ptp2& y)
156 #else
157 # define YB_Impl_Operators_cmpf(_c, _op, _expr, _ptp, _ptp2) \
158 YB_Impl_Operators_f(_c, _op, bool, _expr, const _ptp& x, const _ptp2& y) \
159 YB_Impl_Operators_f(_c, _op, bool, _expr, const op_idt_t<_ptp>& x, \
160 const _ptp2& y) \
161 YB_Impl_Operators_f(_c, _op, bool, _expr, const _ptp& x, \
162 const op_idt_t<_ptp2>& y)
163 #endif
164
166
167 #define YB_Impl_Operators_cmp(_n, _op, _expr, _ptp, _ptp2) \
168 YB_Impl_Operators_bin_spec(_n, YB_Impl_Operators_cmpf, _op, _expr, \
169 _ptp, _ptp2)
170
171 // TODO: Add strictly partial order comparison support to reduce duplicate code
172 // between 'less_than_comparable' and 'partially_ordered'.
173
174 // NOTE: Range 0-5 is reserved for %less_than_comparable. Range 2-3 is also
175 // used by %partially_ordered.
176 YB_Impl_Operators_cmp(0, <=, !bool(x > y), _type, _type2)
177 YB_Impl_Operators_cmp(1, >=, !bool(x < y), _type, _type2)
178 YB_Impl_Operators_cmp(2, >, y < x, _type2, _type)
179 YB_Impl_Operators_cmp(3, <, y > x, _type2, _type)
180 YB_Impl_Operators_cmp(4, <=, !bool(y < x), _type2, _type)
181 YB_Impl_Operators_cmp(5, >=, !bool(y > x), _type2, _type)
182
183 // NOTE: Range 6-8 is reserved for %equality_comparable.
184 YB_Impl_Operators_cmp(6, ==, y == x, _type2, _type)
185 YB_Impl_Operators_cmp(7, !=, !bool(x == y), _type2, _type)
186 YB_Impl_Operators_cmp(8, !=, !bool(x == y), _type, _type2)
187
188 // NOTE: Range 9-10 is reserved for %equivalent.
189 YB_Impl_Operators_cmp(9, !=, !bool(x < y) && !bool(x > y), _type, _type2)
190 YB_Impl_Operators_cmp(10, !=, !bool(x < y) && !bool(y < x), _type, _type2)
191
192 // NOTE: Range 11-14 is reserved for %partially_ordered.
193 YB_Impl_Operators_cmp(11, <=, bool(x < y) || bool(x == y), _type, _type2)
194 YB_Impl_Operators_cmp(12, >=, bool(x > y) || bool(x == y), _type, _type2)
195 YB_Impl_Operators_cmp(13, <=, bool(y > x) || bool(y == x), _type2, _type)
196 YB_Impl_Operators_cmp(14, >=, bool(y < x) || bool(y == x), _type2, _type)
197
198 #undef YB_Impl_Operators_cmp
199 #undef YB_Impl_Operators_cmpf
200
201
202 // NOTE: Offset range 0-1 is reserved for general binary operations. Range 2-3
203 // is for commutative operations. Range 4-5 is for non commutative "left"
204 // operations.
205 yconstfn size_t
206 ops_bin_id(size_t id, size_t off) ynothrow
207 {
208 return (id + 1) * 16 + off;
209 }
210
211 template<size_t _vID, size_t... _vSeq>
212 using ops_bin_id_seq = index_sequence<ops_bin_id(_vID, _vSeq)...>;
213
214 #define YB_Impl_Operators_bin_tmpl(_id, _off, _op, ...) \
215 YB_Impl_Operators_bin_spec(ops_bin_id(_id YPP_Comma _off), \
216 YB_Impl_Operators_f, _op, _type, __VA_ARGS__)
217 #define YB_Impl_Operators_bin(_id, _op) \
218 YB_Impl_Operators_bin_tmpl(_id, 0, _op, x _op##= y, _type x, \
219 const _type2& y) \
220 YB_Impl_Operators_bin_tmpl(_id, 1, _op, x _op##= std::move(y), _type x, \
221 _type2&& y)
222 #define YB_Impl_Operators_con(_id, _op) \
223 YB_Impl_Operators_bin(_id, _op) \
224 YB_Impl_Operators_bin_tmpl(_id, 2, _op, y _op##= x, const _type2& x, \
225 _type y) \
226 YB_Impl_Operators_bin_tmpl(_id, 3, _op, y _op##= std::move(x), _type2&& x, \
227 _type y)
228 #define YB_Impl_Operators_left(_id, _op) \
229 YB_Impl_Operators_bin(_id, _op) \
230 YB_Impl_Operators_bin_tmpl(_id, 4, _op, _type(x) _op##= y, \
231 const _type2& x, const _type& y) \
232 YB_Impl_Operators_bin_tmpl(_id, 5, _op, \
233 _type(x) _op##= std::move(y), const _type2& x, _type&& y)
234
235 YB_Impl_Operators_con(0, +)
236 YB_Impl_Operators_left(1, -)
237 YB_Impl_Operators_con(2, *)
238 YB_Impl_Operators_left(3, /)
239 YB_Impl_Operators_left(4, %)
240 YB_Impl_Operators_con(5, ^)
241 YB_Impl_Operators_con(6, &)
242 YB_Impl_Operators_con(7, |)
243 YB_Impl_Operators_bin(8, <<)
244 YB_Impl_Operators_bin(9, >>)
245
246 #undef YB_Impl_Operators_left
247 #undef YB_Impl_Operators_con
248 #undef YB_Impl_Operators_bin
249 #undef YB_Impl_Operators_bin_tmpl
250
251 #undef YB_Impl_Operators_bin_spec
252 #undef YB_Impl_Operators_bin_ts
253 #undef YB_Impl_Operators_f
254
255 template<class _type, typename _type2, class _tOpt,
256 template<typename...> class... _gOps>
257 using flat_ops = vseq::defer_t<ebases, vseq::fold_t<vseq::_a<vseq::concat_t>,
258 empty_base<>,
259 empty_base<vseq::defer_t<empty_base, _gOps<_type, _type2, _tOpt>>...>>>;
261
262 } // namespace details;
263
264
265 namespace dep_ops
266 {
267
269
270 #define YB_Impl_Operators_Compare(_name, _bseq, _bseq_s) \
271 YB_Impl_Operators_H2_Alias_de(_name, _t<details::ops_seq<_type, _type2, \
272 _tOpt, cond_t<is_same<_type, _type2>, index_sequence<_bseq_s>, \
273 index_sequence<_bseq>>>>)
274
275 YB_Impl_Operators_Compare(less_than_comparable, 0 YPP_Comma 1 YPP_Comma 2
276 YPP_Comma 3 YPP_Comma 4 YPP_Comma 5, 2 YPP_Comma 4 YPP_Comma 1)
277
278
279 YB_Impl_Operators_Compare(equality_comparable, 6 YPP_Comma 7 YPP_Comma 8, 7)
280
281
282 YB_Impl_Operators_Compare(equivalent, 9, 10)
283
284
285 YB_Impl_Operators_Compare(partially_ordered, 11 YPP_Comma 12 YPP_Comma 2
286 YPP_Comma 3 YPP_Comma 13 YPP_Comma 14, 2 YPP_Comma 11 YPP_Comma 14)
287
288 #undef YB_Impl_Operators_Compare
289
290
291 #define YB_Impl_Operators_Binary_Tmpl(_id, _name, _bseq) \
292 YB_Impl_Operators_H2_Alias_de(_name, _t<details::ops_seq<_type, _type2, \
293 _tOpt, details::ops_bin_id_seq<_id, _bseq>>>)
294 #define YB_Impl_Operators_Binary(_id, _name) \
295 YB_Impl_Operators_Binary_Tmpl(_id, _name, 0 YPP_Comma 1)
296 #define YB_Impl_Operators_Commutative(_id, _name) \
297 YB_Impl_Operators_H2_Alias_de(_name, _t< \
298 details::ops_seq<_type, _type2, _tOpt, cond_t<is_same<_type, _type2>, \
299 details::ops_bin_id_seq<_id, 0 YPP_Comma 1>, \
300 details::ops_bin_id_seq<_id, 0 YPP_Comma 1 YPP_Comma 2 YPP_Comma 3>>>>)
301 #define YB_Impl_Operators_Left(_id, _name) \
302 YB_Impl_Operators_H2_Alias_de(_name, _t<details::ops_seq<_type, _type2, \
303 _tOpt, details::ops_bin_id_seq<_id, 0 YPP_Comma 1>>>) \
304 YB_Impl_Operators_H2_Alias_de(_name##_left, _t<details::ops_seq<_type, \
305 _type2, _tOpt, details::ops_bin_id_seq<_id, 4 YPP_Comma 5>>>)
306
307 YB_Impl_Operators_Commutative(0, addable)
308
309
310 YB_Impl_Operators_Left(1, subtractable)
311
312
313 YB_Impl_Operators_Commutative(2, multipliable)
314
315
316 YB_Impl_Operators_Left(3, dividable)
317
318
319 YB_Impl_Operators_Left(4, modable)
320
321
322 YB_Impl_Operators_Binary(5, left_shiftable)
323
324
325 YB_Impl_Operators_Binary(6, right_shiftable)
326
327
328 YB_Impl_Operators_Commutative(7, xorable)
329
330
331 YB_Impl_Operators_Commutative(8, andable)
332
333
334 YB_Impl_Operators_Commutative(9, orable)
335
336 #undef YB_Impl_Operators_Binary_Tmpl
337 #undef YB_Impl_Operators_Left
338 #undef YB_Impl_Operators_Commutative
339 #undef YB_Impl_Operators_Binary
340
341
342 YB_Impl_Operators_H1
343 yimpl(struct) incrementable
344 {
346 friend _type
347 operator++(_type& x, int) ynoexcept(noexcept(_type(x)) && noexcept(++x)
348 && noexcept(_type(std::declval<_type>())))
349 {
350 _type t(x);
351
352 ++x;
353 return t;
354 }
355 };
356
357 YB_Impl_Operators_H1
358 yimpl(struct) decrementable
359 {
361 friend _type
362 operator--(_type& x, int) ynoexcept(noexcept(_type(x)) && noexcept(--x)
363 && noexcept(_type(std::declval<_type>())))
364 {
365 _type t(x);
366
367 ++x;
368 return t;
369 }
370 };
371
372 YB_Impl_Operators_H2
373 yimpl(struct) dereferenceable
374 {
375 // TODO: Add non-const overloaded version? SFINAE?
376 // TODO: Use '_tOpt'.
377 yconstfn decltype(ystdex::addressof(std::declval<const _type2&>()))
378 operator->() const ynoexcept_spec(*std::declval<const _type&>())
379 {
380 return ystdex::addressof(*static_cast<const _type&>(*this));
381 }
382 };
383
384 YB_Impl_Operators_H3
385 yimpl(struct) indexable
386 {
387 // TODO: Add non-const overloaded version? SFINAE?
388 // TODO: Use '_tOpt'.
389 yconstfn _type3
390 operator[](_type2 n) const
391 ynoexcept_spec(*(std::declval<const _type&>() + n))
392 {
393 return *(static_cast<const _type&>(*this) + n);
394 }
395 };
396
397
398 #define YB_Impl_Operators_FlatAlias2_de(_name, ...) \
399 YB_Impl_Operators_H2_Alias_de(_name, details::flat_ops<_type, _type2, \
400 _tOpt, __VA_ARGS__>)
401
402 YB_Impl_Operators_FlatAlias2_de(totally_ordered, less_than_comparable,
403 equality_comparable)
404
405
406 YB_Impl_Operators_FlatAlias2_de(additive, addable, subtractable)
407
408
409 YB_Impl_Operators_FlatAlias2_de(multiplicative, multipliable, dividable)
410
411
412 YB_Impl_Operators_FlatAlias2_de(integer_multiplicative, multiplicative, modable)
413
414
415 YB_Impl_Operators_FlatAlias2_de(arithmetic, additive, multiplicative)
416
417
418 YB_Impl_Operators_FlatAlias2_de(integer_arithmetic, additive,
419 integer_multiplicative)
420
421
422 YB_Impl_Operators_FlatAlias2_de(bitwise, xorable, andable, orable)
423
424
425 YB_Impl_Operators_H1
426 yimpl(using) unit_steppable
427 = details::ebases<incrementable<_type>, decrementable<_type>>;
428
429
430 YB_Impl_Operators_FlatAlias2_de(shiftable, left_shiftable, right_shiftable)
431
432
433 YB_Impl_Operators_FlatAlias2_de(ring_operators, additive, subtractable_left,
434 multipliable)
435
436
437 YB_Impl_Operators_FlatAlias2_de(ordered_ring_operators, ring_operators,
438 totally_ordered)
439
440
441 YB_Impl_Operators_FlatAlias2_de(field_operators, ring_operators, dividable,
442 dividable_left)
443
444
445 YB_Impl_Operators_FlatAlias2_de(ordered_field_operators, field_operators,
446 totally_ordered)
447
448
449 YB_Impl_Operators_FlatAlias2_de(euclidean_ring_operators, ring_operators,
450 dividable, dividable_left, modable, modable_left)
451
452
453 YB_Impl_Operators_FlatAlias2_de(ordered_euclidean_ring_operators,
454 totally_ordered, euclidean_ring_operators)
455
456
457 YB_Impl_Operators_H2_Alias(input_iteratable, details::ebases<
458 equality_comparable<_type, _type, _tOpt>, incrementable<_type>,
459 dereferenceable<_type, _type2, _tOpt>>)
460
461
462 YB_Impl_Operators_H2_Alias(output_iteratable,
463 details::ebases<incrementable<_type>>)
464
465
466 YB_Impl_Operators_H2_Alias(forward_iteratable,
467 details::ebases<input_iteratable<_type, _type2, _tOpt>>)
468
469
470 YB_Impl_Operators_H2_Alias(bidirectional_iteratable, details::ebases<
471 forward_iteratable<_type, _type2, _tOpt>, decrementable<_type>>)
472
473
474 YB_Impl_Operators_H3
475 yimpl(using) random_access_iteratable
476 = details::ebases<bidirectional_iteratable<_type, _type3, _tOpt>,
477 less_than_comparable<_type, _type, _tOpt>,
478 additive<_type, _type2, _tOpt>, indexable<_type, _type2, _type, _tOpt>>;
479
485 YB_Impl_Operators_FlatAlias2_de(operators, totally_ordered, integer_arithmetic,
486 bitwise)
487
488 #undef YB_Impl_Operators_FlatAlias2_de
489
490
491 } // namespace dep_ops;
492
494 using namespace dep_ops;
495
496 #undef YB_Impl_Operators_H3
497 #undef YB_Impl_Operators_H2_Alias_de
498 #undef YB_Impl_Operators_H2_Alias
499 #undef YB_Impl_Operators_H2
500 #undef YB_Impl_Operators_H1
501 #undef YB_Impl_Operators_H_n
502 #undef YB_Impl_Operators_DeOpt
503
504 } // namespace ystdex;
505
506 #endif
507
ystdex::dep_ops::multipliable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, details::ops_bin_id_seq< 2, 0, 1 >, details::ops_bin_id_seq< 2, 0, 1, 2, 3 > >> > multipliable
Definition: operators.hpp:299
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
ystdex::dep_ops::ordered_field_operators
details::flat_ops< _type, _type2, _tOpt, field_operators, totally_ordered > ordered_field_operators
Definition: operators.hpp:432
ystdex::dep_ops::subtractable
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 1, 0, 1 > >> subtractable
Definition: operators.hpp:296
ystdex::dep_ops::addable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, details::ops_bin_id_seq< 0, 0, 1 >, details::ops_bin_id_seq< 0, 0, 1, 2, 3 > >> > addable
Definition: operators.hpp:293
YB_Impl_Operators_bin
#define YB_Impl_Operators_bin(_id, _op)
Definition: operators.hpp:208
ystdex::dep_ops::equality_comparable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 7 >, index_sequence< 6, 7, 8 > >> > equality_comparable
Definition: operators.hpp:265
ystdex::dep_ops::incrementable
Definition: operators.hpp:330
ystdex::dep_ops::integer_arithmetic
details::flat_ops< _type, _type2, _tOpt, additive, integer_multiplicative > integer_arithmetic
Definition: operators.hpp:405
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:1181
YB_Impl_Operators_Commutative
#define YB_Impl_Operators_Commutative(_id, _name)
Definition: operators.hpp:282
YB_Impl_Operators_con
#define YB_Impl_Operators_con(_id, _op)
Definition: operators.hpp:213
ystdex::dep_ops::left_shiftable
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 5, 0, 1 > >> left_shiftable
Definition: operators.hpp:308
ystdex::details::bin_ops
Definition: operators.hpp:111
YPP_Comma
#define YPP_Comma
替换为逗号的预处理记号。
Definition: ydef.h:370
ystdex::dep_ops::additive
details::flat_ops< _type, _type2, _tOpt, addable, subtractable > additive
Definition: operators.hpp:392
ystdex::dep_ops::shiftable
details::flat_ops< _type, _type2, _tOpt, left_shiftable, right_shiftable > shiftable
Definition: operators.hpp:416
ystdex::dep_ops::dereferenceable
Definition: operators.hpp:360
ystdex::dep_ops::no_constfn
false_ no_constfn
Definition: operators.hpp:59
ystdex::details::flat_ops
template< typename... > class _gOps using flat_ops
Definition: operators.hpp:243
ystdex::dep_ops::partially_ordered
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 2, 11, 14 >, index_sequence< 11, 12, 2, 3, 13, 14 > >> > partially_ordered
Definition: operators.hpp:272
ystdex::dep_ops::andable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, details::ops_bin_id_seq< 8, 0, 1 >, details::ops_bin_id_seq< 8, 0, 1, 2, 3 > >> > andable
Definition: operators.hpp:317
YB_Impl_Operators_H2
#define YB_Impl_Operators_H2
Definition: operators.hpp:69
YB_Impl_Operators_cmp
#define YB_Impl_Operators_cmp(_n, _op, _expr, _ptp, _ptp2)
Definition: operators.hpp:167
ystdex::details::_type2
_type2
Definition: operators.hpp:241
ystdex::dep_ops::modable_left
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 4, 4, 5 > >> modable_left
Definition: operators.hpp:305
YB_Impl_Operators_Binary
#define YB_Impl_Operators_Binary(_id, _name)
Definition: operators.hpp:280
ystdex::dep_ops::dividable_left
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 3, 4, 5 > >> dividable_left
Definition: operators.hpp:302
ystdex::details::ebases
Definition: operators.hpp:108
ystdex::dep_ops::dividable
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 3, 0, 1 > >> dividable
Definition: operators.hpp:302
ystdex::dep_ops::ordered_ring_operators
details::flat_ops< _type, _type2, _tOpt, ring_operators, totally_ordered > ordered_ring_operators
Definition: operators.hpp:424
ystdex::dep_ops::ordered_euclidean_ring_operators
details::flat_ops< _type, _type2, _tOpt, totally_ordered, euclidean_ring_operators > ordered_euclidean_ring_operators
Definition: operators.hpp:440
YB_Impl_Operators_Compare
#define YB_Impl_Operators_Compare(_name, _bseq, _bseq_s)
Definition: operators.hpp:256
ystdex::dep_ops::orable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, details::ops_bin_id_seq< 9, 0, 1 >, details::ops_bin_id_seq< 9, 0, 1, 2, 3 > >> > orable
Definition: operators.hpp:320
ystdex::details::op_idt::type
_type type
Definition: operators.hpp:92
std
Definition: optional.h:982
ystdex::dep_ops::ring_operators
details::flat_ops< _type, _type2, _tOpt, additive, subtractable_left, multipliable > ring_operators
Definition: operators.hpp:420
ystdex::dep_ops::bitwise
details::flat_ops< _type, _type2, _tOpt, xorable, andable, orable > bitwise
Definition: operators.hpp:408
integer_sequence.hpp
整数序列元编程接口。
ystdex::dep_ops::totally_ordered
details::flat_ops< _type, _type2, _tOpt, less_than_comparable, equality_comparable > totally_ordered
Definition: operators.hpp:389
ystdex::dep_ops::subtractable_left
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 1, 4, 5 > >> subtractable_left
Definition: operators.hpp:296
YB_Impl_Operators_FlatAlias2_de
#define YB_Impl_Operators_FlatAlias2_de(_name,...)
Definition: operators.hpp:384
ystdex::dep_ops::operators
details::flat_ops< _type, _type2, _tOpt, totally_ordered, integer_arithmetic, bitwise > operators
Definition: operators.hpp:472
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
ystdex::details::ops_bin_id_seq
index_sequence< ops_bin_id(_vID, _vSeq)... > ops_bin_id_seq
Definition: operators.hpp:203
ystdex::true_
bool_< true > true_
Definition: integral_constant.hpp:109
ystdex::dep_ops::euclidean_ring_operators
details::flat_ops< _type, _type2, _tOpt, ring_operators, dividable, dividable_left, modable, modable_left > euclidean_ring_operators
Definition: operators.hpp:436
YB_Impl_Operators_Left
#define YB_Impl_Operators_Left(_id, _name)
Definition: operators.hpp:287
YB_Impl_Operators_left
#define YB_Impl_Operators_left(_id, _op)
Definition: operators.hpp:219
YB_Impl_Operators_H1
#define YB_Impl_Operators_H1
Definition: operators.hpp:67
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
ystdex::dep_ops::less_than_comparable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 2, 4, 1 >, index_sequence< 0, 1, 2, 3, 4, 5 > >> > less_than_comparable
Definition: operators.hpp:262
ystdex::dep_ops::decrementable
Definition: operators.hpp:345
ystdex::dep_ops::equivalent
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 10 >, index_sequence< 9 > >> > equivalent
Definition: operators.hpp:268
ystdex::dep_ops::right_shiftable
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 6, 0, 1 > >> right_shiftable
Definition: operators.hpp:311
ystdex::addressof
enable_if_t< has_no_overloaded_addressof< _type >::value, _type * > addressof(_type &r)
尝试对非重载 operator& 提供 constexpr 的 std::addressof 替代。
Definition: addressof.hpp:131
ystdex::_t
typename _type::type _t
嵌套类型别名。
Definition: meta.hpp:45
ystdex::details::ops_seq
Definition: operators.hpp:114
ystdex::dep_ops::multiplicative
details::flat_ops< _type, _type2, _tOpt, multipliable, dividable > multiplicative
Definition: operators.hpp:395
ystdex::cpp2014::index_sequence
integer_sequence< size_t, _vSeq... > index_sequence
Definition: integer_sequence.hpp:65
ystdex::details::op_idt_t
_t< op_idt< _type > > op_idt_t
Definition: operators.hpp:100
ystdex::cpp2014::integer_sequence
Definition: integer_sequence.hpp:53
ystdex::dep_ops::indexable
Definition: operators.hpp:372
ystdex::dep_ops::field_operators
details::flat_ops< _type, _type2, _tOpt, ring_operators, dividable, dividable_left > field_operators
Definition: operators.hpp:428
YB_Impl_Operators_H3
#define YB_Impl_Operators_H3
Definition: operators.hpp:80
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
ystdex::details::op_idt
Definition: operators.hpp:91
addressof.hpp
一元操作符 & 和取指针的相关接口。
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
ystdex::dep_ops::arithmetic
details::flat_ops< _type, _type2, _tOpt, additive, multiplicative > arithmetic
Definition: operators.hpp:401
ystdex::dep_ops::modable
_t< details::ops_seq< _type, _type2, _tOpt, details::ops_bin_id_seq< 4, 0, 1 > >> modable
Definition: operators.hpp:305
ystdex::false_
bool_< false > false_
Definition: integral_constant.hpp:110
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
ystdex::dep_ops::use_constfn
true_ use_constfn
Definition: operators.hpp:61
YB_Impl_Operators_H2_Alias
#define YB_Impl_Operators_H2_Alias(_name,...)
Definition: operators.hpp:74
ystdex::details::off
size_t off
Definition: operators.hpp:198
ynoexcept
#define ynoexcept(...)
YSLib 无异常抛出保证：指定特定的异常规范。
Definition: ydef.h:1151
ystdex::dep_ops::integer_multiplicative
details::flat_ops< _type, _type2, _tOpt, multiplicative, modable > integer_multiplicative
Definition: operators.hpp:398
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
ystdex::dep_ops::xorable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, details::ops_bin_id_seq< 7, 0, 1 >, details::ops_bin_id_seq< 7, 0, 1, 2, 3 > >> > xorable
Definition: operators.hpp:314