YSTest: operators.hpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

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