micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
detail.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can
9 * be obtained from https://opensource.org/licenses/mit.
10 *
11 * Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12 * released under the terms of the Boost Version 1.0 Software License,
13 * which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14 */
15
16// ----------------------------------------------------------------------------
17
41
42#ifndef MICRO_TEST_PLUS_DETAIL_H_
43#define MICRO_TEST_PLUS_DETAIL_H_
44
45// ----------------------------------------------------------------------------
46
47#ifdef __cplusplus
48
49// ----------------------------------------------------------------------------
50
51#include <stdio.h>
52#include <string>
53
54// ----------------------------------------------------------------------------
55
56#if defined(__GNUC__)
57#pragma GCC diagnostic push
58#pragma GCC diagnostic ignored "-Wpadded"
59#pragma GCC diagnostic ignored "-Waggregate-return"
60#if defined(__clang__)
61#pragma clang diagnostic ignored "-Wc++98-compat"
62#endif
63#endif
64
66{
67 // --------------------------------------------------------------------------
68
92 namespace detail
93 {
111 template <class Expr_T>
113 {
117 Expr_T expr{};
118
123 };
124
125 // ------------------------------------------------------------------------
126
127 // in C++14/17/20, a function template with a deduced return type
128 // (auto) cannot be used before its definition is visible.
129 // Therefore it is not possible to split definitions.
130
158 template <class T>
159 [[nodiscard]] constexpr auto
160 get_impl (const T& t, int) -> decltype (t.get ())
161 {
162 return t.get ();
163 }
164
187 template <class T>
188 [[nodiscard]] constexpr auto
189 get_impl (const T& t, ...) -> decltype (auto)
190 {
191 return t;
192 }
193
221 template <class T>
222 [[nodiscard]] constexpr auto
223 get (const T& t)
224 {
225 // Call the variadic function, basically to force it return `t`.
226 return get_impl<T> (t, 0);
227 }
228
229 // ------------------------------------------------------------------------
230
258 template <class Lhs_T, class Rhs_T>
260 {
272 constexpr eq_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
273 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
274 // This lambda is called in the constructor to
275 // evaluate the comparison.
276 using std::operator==;
277 using std::operator<;
278
279#if defined(__GNUC__)
280#pragma GCC diagnostic push
281#pragma GCC diagnostic ignored "-Wfloat-equal"
282#pragma GCC diagnostic ignored "-Wconversion"
283#pragma GCC diagnostic ignored "-Wdouble-promotion"
284#pragma GCC diagnostic ignored "-Wsign-compare"
285#if defined(__clang__)
286#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
287#pragma clang diagnostic ignored "-Wpedantic"
288#endif
289#endif
292 {
293 // If both types have values (like numeric constants),
294 // compare them directly.
295 return Lhs_T::value == Rhs_T::value;
296 }
297 else if constexpr (type_traits::has_epsilon_v<Lhs_T>
299 {
300 // If both values have precision, compare them using
301 // the smalles precision.
302 return math::abs (get (lhs) - get (rhs))
303 < math::min_value (Lhs_T::epsilon, Rhs_T::epsilon);
304 }
305 else if constexpr (type_traits::has_epsilon_v<Lhs_T>)
306 {
307 // If only the left operand has precision, use it.
308 return math::abs (get (lhs) - get (rhs)) < Lhs_T::epsilon;
309 }
310 else if constexpr (type_traits::has_epsilon_v<Rhs_T>)
311 {
312 // If only the right operand has precision, use it.
313 return math::abs (get (lhs) - get (rhs)) < Rhs_T::epsilon;
314 }
315 else
316 {
317 // Call the generic getters, which might
318 // either call the type get() or return the value.
319 return get (lhs) == get (rhs);
320 }
321#if defined(__GNUC__)
322#pragma GCC diagnostic pop
323#endif
324 }() }
325 {
326 }
327
339 [[nodiscard]] constexpr
340 operator bool () const
341 {
342 return value_;
343 }
344
357 [[nodiscard]] constexpr auto
358 lhs (void) const
359 {
360 return get (lhs_);
361 }
362
375 [[nodiscard]] constexpr auto
376 rhs (void) const
377 {
378 return get (rhs_);
379 }
380
384 const Lhs_T lhs_{};
385
389 const Rhs_T rhs_{};
390
394 const bool value_{};
395 };
396
397 // Deduction guide.
398 template <typename Lhs_T, typename Rhs_T>
399 eq_ (const Lhs_T&, const Rhs_T&) -> eq_<Lhs_T, Rhs_T>;
400
401 // ------------------------------------------------------------------------
402
430 template <class Lhs_T, class Rhs_T>
432 {
444 constexpr ne_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
445 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
446 using std::operator==;
447 using std::operator!=;
448 using std::operator>;
449
450#if defined(__GNUC__)
451#pragma GCC diagnostic push
452#pragma GCC diagnostic ignored "-Wfloat-equal"
453#pragma GCC diagnostic ignored "-Wconversion"
454#pragma GCC diagnostic ignored "-Wdouble-promotion"
455#pragma GCC diagnostic ignored "-Wsign-compare"
456#if defined(__clang__)
457#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
458#pragma clang diagnostic ignored "-Wpedantic"
459#endif
460#endif
463 {
464 return Lhs_T::value != Rhs_T::value;
465 }
466 else if constexpr (type_traits::has_epsilon_v<Lhs_T>
467 and type_traits::has_epsilon_v<Rhs_T>)
468 {
469 return math::abs (get (lhs_) - get (rhs_))
470 > math::min_value (Lhs_T::epsilon, Rhs_T::epsilon);
471 }
472 else if constexpr (type_traits::has_epsilon_v<Lhs_T>)
473 {
474 return math::abs (get (lhs_) - get (rhs_)) > Lhs_T::epsilon;
475 }
476 else if constexpr (type_traits::has_epsilon_v<Rhs_T>)
477 {
478 return math::abs (get (lhs_) - get (rhs_)) > Rhs_T::epsilon;
479 }
480 else
481 {
482 return get (lhs_) != get (rhs_);
483 }
484#if defined(__GNUC__)
485#pragma GCC diagnostic pop
486#endif
487 }() }
488 {
489 }
490
502 [[nodiscard]] constexpr
503 operator bool () const
504 {
505 return value_;
506 }
507
520 [[nodiscard]] constexpr auto
521 lhs (void) const
522 {
523 return get (lhs_);
524 }
525
538 [[nodiscard]] constexpr auto
539 rhs (void) const
540 {
541 return get (rhs_);
542 }
543
547 const Lhs_T lhs_{};
548
552 const Rhs_T rhs_{};
553
557 const bool value_{};
558 };
559
560 // Deduction guide.
561 template <typename Lhs_T, typename Rhs_T>
562 ne_ (const Lhs_T&, const Rhs_T&) -> ne_<Lhs_T, Rhs_T>;
563
564 // ------------------------------------------------------------------------
565
591 template <class Lhs_T, class Rhs_T>
593 {
605 constexpr gt_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
606 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
607 using std::operator>;
608
609#if defined(__GNUC__)
610#pragma GCC diagnostic push
611#pragma GCC diagnostic ignored "-Wconversion"
612#pragma GCC diagnostic ignored "-Wdouble-promotion"
613#pragma GCC diagnostic ignored "-Wsign-compare"
614#if defined(__clang__)
615#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
616#pragma clang diagnostic ignored "-Wpedantic"
617#endif
618#endif
621 {
622 return Lhs_T::value > Rhs_T::value;
623 }
624 else
625 {
626 return get (lhs_) > get (rhs_);
627 }
628#if defined(__GNUC__)
629#pragma GCC diagnostic pop
630#endif
631 }() }
632 {
633 }
634
647 [[nodiscard]] constexpr
648 operator bool () const
649 {
650 return value_;
651 }
652
665 [[nodiscard]] constexpr auto
666 lhs (void) const
667 {
668 return get (lhs_);
669 }
670 [[nodiscard]] constexpr auto
671
684 rhs (void) const
685 {
686 return get (rhs_);
687 }
688
692 const Lhs_T lhs_{};
693
697 const Rhs_T rhs_{};
698
702 const bool value_{};
703 };
704
705 // Deduction guide.
706 template <typename Lhs_T, typename Rhs_T>
707 gt_ (const Lhs_T&, const Rhs_T&) -> gt_<Lhs_T, Rhs_T>;
708
709 // ------------------------------------------------------------------------
710
736 template <class Lhs_T, class Rhs_T>
738 {
752 constexpr ge_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
753 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
754 using std::operator>=;
755
756#if defined(__GNUC__)
757#pragma GCC diagnostic push
758#pragma GCC diagnostic ignored "-Wconversion"
759#pragma GCC diagnostic ignored "-Wdouble-promotion"
760#pragma GCC diagnostic ignored "-Wsign-compare"
761#if defined(__clang__)
762#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
763#pragma clang diagnostic ignored "-Wpedantic"
764#endif
765#endif
768 {
769 return Lhs_T::value >= Rhs_T::value;
770 }
771 else
772 {
773 return get (lhs_) >= get (rhs_);
774 }
775#if defined(__GNUC__)
776#pragma GCC diagnostic pop
777#endif
778 }() }
779 {
780 }
781
794 [[nodiscard]] constexpr
795 operator bool () const
796 {
797 return value_;
798 }
799
812 [[nodiscard]] constexpr auto
813 lhs (void) const
814 {
815 return get (lhs_);
816 }
817
830 [[nodiscard]] constexpr auto
831 rhs (void) const
832 {
833 return get (rhs_);
834 }
835
839 const Lhs_T lhs_{};
840
844 const Rhs_T rhs_{};
845
849 const bool value_{};
850 };
851
852 // Deduction guide.
853 template <typename Lhs_T, typename Rhs_T>
854 ge_ (const Lhs_T&, const Rhs_T&) -> ge_<Lhs_T, Rhs_T>;
855
856 // ------------------------------------------------------------------------
857
883 template <class Lhs_T, class Rhs_T>
885 {
897 constexpr lt_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
898 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
899 using std::operator<;
900
901#if defined(__GNUC__)
902#pragma GCC diagnostic push
903#pragma GCC diagnostic ignored "-Wconversion"
904#pragma GCC diagnostic ignored "-Wdouble-promotion"
905#pragma GCC diagnostic ignored "-Wsign-compare"
906#if defined(__clang__)
907#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
908#pragma clang diagnostic ignored "-Wpedantic"
909#endif
910#endif
913 {
914 return Lhs_T::value < Rhs_T::value;
915 }
916 else
917 {
918 return get (lhs_) < get (rhs_);
919 }
920#if defined(__GNUC__)
921#pragma GCC diagnostic pop
922#endif
923 }() }
924 {
925 }
926
939 [[nodiscard]] constexpr
940 operator bool () const
941 {
942 return value_;
943 }
944
957 [[nodiscard]] constexpr auto
958 lhs (void) const
959 {
960 return get (lhs_);
961 }
962
975 [[nodiscard]] constexpr auto
976 rhs (void) const
977 {
978 return get (rhs_);
979 }
980
981 private:
985 const Lhs_T lhs_{};
986
990 const Rhs_T rhs_{};
991
995 const bool value_{};
996 };
997
998 // Deduction guide.
999 template <typename Lhs_T, typename Rhs_T>
1000 lt_ (const Lhs_T&, const Rhs_T&) -> lt_<Lhs_T, Rhs_T>;
1001
1002 // ------------------------------------------------------------------------
1003
1029 template <class Lhs_T, class Rhs_T>
1031 {
1045 constexpr le_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1046 : lhs_{ lhs }, rhs_{ rhs }, value_{ [&] {
1047 using std::operator<=;
1048
1049#if defined(__GNUC__)
1050#pragma GCC diagnostic push
1051#pragma GCC diagnostic ignored "-Wconversion"
1052#pragma GCC diagnostic ignored "-Wdouble-promotion"
1053#pragma GCC diagnostic ignored "-Wsign-compare"
1054#if defined(__clang__)
1055#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
1056#pragma clang diagnostic ignored "-Wpedantic"
1057#endif
1058#endif
1061 {
1062 return Lhs_T::value <= Rhs_T::value;
1063 }
1064 else
1065 {
1066 return get (lhs_) <= get (rhs_);
1067 }
1068#if defined(__GNUC__)
1069#pragma GCC diagnostic pop
1070#endif
1071 }() }
1072 {
1073 }
1074
1087 [[nodiscard]] constexpr
1088 operator bool () const
1089 {
1090 return value_;
1091 }
1092
1105
1106 [[nodiscard]] constexpr auto
1107 lhs (void) const
1108 {
1109 return get (lhs_);
1110 }
1111
1124 [[nodiscard]] constexpr auto
1125 rhs (void) const
1126 {
1127 return get (rhs_);
1128 }
1129
1133 const Lhs_T lhs_{};
1134
1138 const Rhs_T rhs_{};
1139
1143 const bool value_{};
1144 };
1145
1146 // Deduction guide.
1147 template <typename Lhs_T, typename Rhs_T>
1148 le_ (const Lhs_T&, const Rhs_T&) -> le_<Lhs_T, Rhs_T>;
1149
1150 // ------------------------------------------------------------------------
1151
1176 template <class Lhs_T, class Rhs_T>
1178 {
1190 constexpr and_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1191 : lhs_{ lhs }, rhs_{ rhs },
1192 value_{ static_cast<bool> (lhs) and static_cast<bool> (rhs) }
1193 {
1194 }
1195
1207 [[nodiscard]] constexpr
1208 operator bool () const
1209 {
1210 return value_;
1211 }
1212
1225 [[nodiscard]] constexpr auto
1226 lhs (void) const
1227 {
1228 return get (lhs_);
1229 }
1230
1243 [[nodiscard]] constexpr auto
1244 rhs (void) const
1245 {
1246 return get (rhs_);
1247 }
1248
1252 const Lhs_T lhs_{};
1253
1257 const Rhs_T rhs_{};
1258
1262 const bool value_{};
1263 };
1264
1265 // Deduction guide.
1266 template <typename Lhs_T, typename Rhs_T>
1267 and_ (const Lhs_T&, const Rhs_T&) -> and_<Lhs_T, Rhs_T>;
1268
1269 // ------------------------------------------------------------------------
1270
1295 template <class Lhs_T, class Rhs_T>
1297 {
1309 constexpr or_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1310 : lhs_{ lhs }, rhs_{ rhs },
1311 value_{ static_cast<bool> (lhs) or static_cast<bool> (rhs) }
1312 {
1313 }
1314
1326 [[nodiscard]] constexpr
1327 operator bool () const
1328 {
1329 return value_;
1330 }
1331
1344 [[nodiscard]] constexpr auto
1345 lhs (void) const
1346 {
1347 return get (lhs_);
1348 }
1349
1362 [[nodiscard]] constexpr auto
1363 rhs (void) const
1364 {
1365 return get (rhs_);
1366 }
1367
1371 const Lhs_T lhs_{};
1372
1376 const Rhs_T rhs_{};
1377
1381 const bool value_{};
1382 };
1383
1384 // Deduction guide.
1385 template <typename Lhs_T, typename Rhs_T>
1386 or_ (const Lhs_T&, const Rhs_T&) -> or_<Lhs_T, Rhs_T>;
1387
1388 // ------------------------------------------------------------------------
1389
1413 template <class T>
1415 {
1426 explicit constexpr not_ (const T& t = {})
1427 : t_{ t }, value_{ not static_cast<bool> (t) }
1428 {
1429 }
1430
1442 [[nodiscard]] constexpr
1443 operator bool () const
1444 {
1445 return value_;
1446 }
1447
1459 [[nodiscard]] constexpr auto
1460 value () const
1461 {
1462 return get (t_);
1463 }
1464
1468 const T t_{};
1469
1473 const bool value_{};
1474 };
1475
1476 // Deduction guide.
1477 template <typename T>
1478 not_ (const T&) -> not_<T>;
1479
1480 // ------------------------------------------------------------------------
1481
1482#if defined(__cpp_exceptions)
1483
1510 template <class Callable_T, class Exception_T = void>
1512 {
1524 constexpr explicit throws_ (const Callable_T& func)
1525 : value_{ [&func] {
1526 try
1527 {
1528 func ();
1529 }
1530 catch (const Exception_T&)
1531 {
1532 return true;
1533 }
1534 catch (...)
1535 {
1536 return false;
1537 }
1538 return false;
1539 }() }
1540 {
1541 }
1542
1555 [[nodiscard]] constexpr
1556 operator bool () const
1557 {
1558 return value_;
1559 }
1560
1564 const bool value_{};
1565 };
1566
1567 // ------------------------------------------------------------------------
1568
1593 template <class Callable_T>
1594 struct throws_<Callable_T, void> : type_traits::op
1595 {
1607 constexpr explicit throws_ (const Callable_T& func)
1608 : value_{ [&func] {
1609 try
1610 {
1611 func ();
1612 }
1613 catch (...)
1614 {
1615 return true;
1616 }
1617 return false;
1618 }() }
1619 {
1620 }
1621
1633 [[nodiscard]] constexpr
1634 operator bool () const
1635 {
1636 return value_;
1637 }
1638
1642 const bool value_{};
1643 };
1644
1645 // ------------------------------------------------------------------------
1646
1671 template <class Callable_T>
1673 {
1684 constexpr explicit nothrow_ (const Callable_T& func)
1685 : value_{ [&func] {
1686 try
1687 {
1688 func ();
1689 }
1690 catch (...)
1691 {
1692 return false;
1693 }
1694 return true;
1695 }() }
1696 {
1697 }
1698
1710 [[nodiscard]] constexpr
1711 operator bool () const
1712 {
1713 return value_;
1714 }
1715
1719 const bool value_{};
1720 };
1721
1722#endif
1723
1724 // ------------------------------------------------------------------------
1725
1745 {
1746 public:
1754 const reflection::source_location location);
1755
1760
1769 template <class T>
1770 auto&
1771 operator<< (const T& msg);
1772
1785 [[nodiscard]] constexpr bool
1786 value () const
1787 {
1788 return value_;
1789 }
1790
1791 protected:
1795 bool value_{};
1796
1801 bool abort_ = false;
1802
1807
1812 std::string message_{};
1813 };
1814
1815 // ------------------------------------------------------------------------
1816
1835 template <class Expr_T>
1837 {
1838 public:
1851 constexpr explicit deferred_reporter (
1852 const Expr_T& expr, bool abort,
1853 const reflection::source_location& location);
1854
1859
1860 protected:
1864 const Expr_T expr_{};
1865 };
1866
1867 // ------------------------------------------------------------------------
1868 } // namespace detail
1869
1870 // --------------------------------------------------------------------------
1871} // namespace micro_os_plus::micro_test_plus
1872
1873#if defined(__GNUC__)
1874#pragma GCC diagnostic pop
1875#endif
1876
1877// ----------------------------------------------------------------------------
1878
1879#endif // __cplusplus
1880
1881// ----------------------------------------------------------------------------
1882
1883#endif // MICRO_TEST_PLUS_DETAIL_H_
1884
1885// ----------------------------------------------------------------------------
const reflection::source_location location_
Stores the source location associated with the report.
Definition detail.h:1806
constexpr bool value() const
Retrieves the result value.
Definition detail.h:1786
std::string message_
String to collect the expectation message passed via operator<<().
Definition detail.h:1812
bool abort_
Indicates whether the reporting should abort further processing.
Definition detail.h:1801
deferred_reporter_base(bool value, const reflection::source_location location)
Constructs a deferred reporter base.
bool value_
Stores the result value of the report.
Definition detail.h:1795
constexpr deferred_reporter(const Expr_T &expr, bool abort, const reflection::source_location &location)
Constructs a deferred reporter for a specific expression.
const Expr_T expr_
Stores the expression under evaluation.
Definition detail.h:1864
Local implementation of source location information for diagnostics.
Definition reflection.h:137
Internal implementation details for the µTest++ framework.
constexpr auto get_impl(const T &t, int) -> decltype(t.get())
Generic getter function template for value retrieval.
Definition detail.h:160
constexpr auto get(const T &t)
Generic getter function template for value retrieval.
Definition detail.h:223
constexpr auto abs(const T t) -> T
Computes the absolute value of a given comparable value.
constexpr auto min_value(const T &lhs, const T &rhs) -> const T &
Computes the minimum of two comparable values.
static constexpr auto has_epsilon_v
Variable template to determine if a type provides an epsilon member.
static constexpr auto has_value_v
Variable template to determine if a type provides a value member.
Primary namespace for the µTest++ testing framework.
Logical AND comparator struct template.
Definition detail.h:1178
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1244
const bool value_
Stores the result of the logical AND operation.
Definition detail.h:1262
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1257
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1226
constexpr and_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a logical AND comparator for the given operands.
Definition detail.h:1190
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1252
Assertion struct template for parameter passing to the evaluator.
Definition detail.h:113
Expr_T expr
The expression under evaluation.
Definition detail.h:117
reflection::source_location location
The source location associated with the assertion.
Definition detail.h:122
Equality comparator struct template.
Definition detail.h:260
constexpr eq_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs an equality comparator for the given operands.
Definition detail.h:272
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:376
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:384
const bool value_
Stores the result of the equality comparison.
Definition detail.h:394
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:358
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:389
Greater than or equal comparator struct template.
Definition detail.h:738
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:839
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:831
constexpr ge_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a greater than or equal comparator for the given operands.
Definition detail.h:752
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:844
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:813
const bool value_
Stores the result of the greater than or equal comparison.
Definition detail.h:849
Greater than comparator struct template.
Definition detail.h:593
constexpr gt_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a greater than comparator for the given operands.
Definition detail.h:605
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:666
const bool value_
Stores the result of the greater than comparison.
Definition detail.h:702
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:684
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:692
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:697
Less than or equal comparator struct template.
Definition detail.h:1031
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1125
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1133
const bool value_
Stores the result of the less than or equal comparison.
Definition detail.h:1143
constexpr le_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a less than or equal comparator for the given operands.
Definition detail.h:1045
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1138
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1107
Less than comparator struct template.
Definition detail.h:885
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:985
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:958
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:976
const bool value_
Stores the result of the less than comparison.
Definition detail.h:995
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:990
constexpr lt_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a less than comparator for the given operands.
Definition detail.h:897
Non-equality comparator struct template.
Definition detail.h:432
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:552
constexpr ne_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a non-equality comparator for the given operands.
Definition detail.h:444
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:539
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:521
const bool value_
Stores the result of the non-equality comparison.
Definition detail.h:557
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:547
Logical NOT comparator struct template.
Definition detail.h:1415
constexpr auto value() const
Retrieves the value of the operand.
Definition detail.h:1460
constexpr not_(const T &t={})
Constructs a logical NOT comparator for the given operand.
Definition detail.h:1426
const bool value_
Stores the result of the logical NOT operation.
Definition detail.h:1473
constexpr nothrow_(const Callable_T &func)
Constructs a nothrow checking operator for the given callable.
Definition detail.h:1684
const bool value_
Stores the result of the nothrow check.
Definition detail.h:1719
Logical OR comparator struct template.
Definition detail.h:1297
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1371
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1376
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1363
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1345
constexpr or_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a logical OR comparator for the given operands.
Definition detail.h:1309
const bool value_
Stores the result of the logical OR operation.
Definition detail.h:1381
constexpr throws_(const Callable_T &func)
Constructs an exception checking operator for the given callable.
Definition detail.h:1607
const bool value_
Stores the result of the exception check.
Definition detail.h:1642
constexpr throws_(const Callable_T &func)
Constructs an exception checking operator for the given callable.
Definition detail.h:1524
const bool value_
Stores the result of the exception check.
Definition detail.h:1564
Empty base struct for all operator types.