micro-test-plus 3.3.1
µ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-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * 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 be
9 * 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 [&]
275 {
276 // This lambda is called in the constructor to
277 // evaluate the comparison.
278 using std::operator==;
279 using std::operator<;
280
281#if defined(__GNUC__)
282#pragma GCC diagnostic push
283#pragma GCC diagnostic ignored "-Wfloat-equal"
284#pragma GCC diagnostic ignored "-Wconversion"
285#pragma GCC diagnostic ignored "-Wdouble-promotion"
286#pragma GCC diagnostic ignored "-Wsign-compare"
287#if defined(__clang__)
288#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
289#pragma clang diagnostic ignored "-Wpedantic"
290#endif
291#endif
294 {
295 // If both types have values (like numeric constants),
296 // compare them directly.
297 return Lhs_T::value == Rhs_T::value;
298 }
299 else if constexpr (type_traits::has_epsilon_v<Lhs_T>
301 {
302 // If both values have precision, compare them using
303 // the smalles precision.
304 return math::abs (get (lhs) - get (rhs))
305 < math::min_value (Lhs_T::epsilon,
306 Rhs_T::epsilon);
307 }
308 else if constexpr (type_traits::has_epsilon_v<Lhs_T>)
309 {
310 // If only the left operand has precision, use it.
311 return math::abs (get (lhs) - get (rhs))
312 < Lhs_T::epsilon;
313 }
314 else if constexpr (type_traits::has_epsilon_v<Rhs_T>)
315 {
316 // If only the right operand has precision, use it.
317 return math::abs (get (lhs) - get (rhs))
318 < Rhs_T::epsilon;
319 }
320 else
321 {
322 // Call the generic getters, which might
323 // either call the type get() or return the value.
324 return get (lhs) == get (rhs);
325 }
326#if defined(__GNUC__)
327#pragma GCC diagnostic pop
328#endif
329 }()
330 }
331 {
332 }
333
345 [[nodiscard]] constexpr
346 operator bool () const
347 {
348 return value_;
349 }
350
363 [[nodiscard]] constexpr auto
364 lhs (void) const
365 {
366 return get (lhs_);
367 }
368
381 [[nodiscard]] constexpr auto
382 rhs (void) const
383 {
384 return get (rhs_);
385 }
386
390 const Lhs_T lhs_{};
391
395 const Rhs_T rhs_{};
396
400 const bool value_{};
401 };
402
403 // Deduction guide.
404 template <typename Lhs_T, typename Rhs_T>
405 eq_ (const Lhs_T&, const Rhs_T&) -> eq_<Lhs_T, Rhs_T>;
406
407 // ------------------------------------------------------------------------
408
436 template <class Lhs_T, class Rhs_T>
438 {
450 constexpr ne_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
451 : lhs_{ lhs }, rhs_{ rhs }, value_{
452 [&]
453 {
454 using std::operator==;
455 using std::operator!=;
456 using std::operator>;
457
458#if defined(__GNUC__)
459#pragma GCC diagnostic push
460#pragma GCC diagnostic ignored "-Wfloat-equal"
461#pragma GCC diagnostic ignored "-Wconversion"
462#pragma GCC diagnostic ignored "-Wdouble-promotion"
463#pragma GCC diagnostic ignored "-Wsign-compare"
464#if defined(__clang__)
465#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
466#pragma clang diagnostic ignored "-Wpedantic"
467#endif
468#endif
471 {
472 return Lhs_T::value != Rhs_T::value;
473 }
474 else if constexpr (type_traits::has_epsilon_v<Lhs_T>
475 and type_traits::has_epsilon_v<Rhs_T>)
476 {
477 return math::abs (get (lhs_) - get (rhs_))
478 > math::min_value (Lhs_T::epsilon,
479 Rhs_T::epsilon);
480 }
481 else if constexpr (type_traits::has_epsilon_v<Lhs_T>)
482 {
483 return math::abs (get (lhs_) - get (rhs_))
484 > Lhs_T::epsilon;
485 }
486 else if constexpr (type_traits::has_epsilon_v<Rhs_T>)
487 {
488 return math::abs (get (lhs_) - get (rhs_))
489 > Rhs_T::epsilon;
490 }
491 else
492 {
493 return get (lhs_) != get (rhs_);
494 }
495#if defined(__GNUC__)
496#pragma GCC diagnostic pop
497#endif
498 }()
499 }
500 {
501 }
502
514 [[nodiscard]] constexpr
515 operator bool () const
516 {
517 return value_;
518 }
519
532 [[nodiscard]] constexpr auto
533 lhs (void) const
534 {
535 return get (lhs_);
536 }
537
550 [[nodiscard]] constexpr auto
551 rhs (void) const
552 {
553 return get (rhs_);
554 }
555
559 const Lhs_T lhs_{};
560
564 const Rhs_T rhs_{};
565
569 const bool value_{};
570 };
571
572 // Deduction guide.
573 template <typename Lhs_T, typename Rhs_T>
574 ne_ (const Lhs_T&, const Rhs_T&) -> ne_<Lhs_T, Rhs_T>;
575
576 // ------------------------------------------------------------------------
577
603 template <class Lhs_T, class Rhs_T>
605 {
617 constexpr gt_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
618 : lhs_{ lhs }, rhs_{ rhs },
619 value_{ [&]
620 {
621 using std::operator>;
622
623#if defined(__GNUC__)
624#pragma GCC diagnostic push
625#pragma GCC diagnostic ignored "-Wconversion"
626#pragma GCC diagnostic ignored "-Wdouble-promotion"
627#pragma GCC diagnostic ignored "-Wsign-compare"
628#if defined(__clang__)
629#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
630#pragma clang diagnostic ignored "-Wpedantic"
631#endif
632#endif
635 {
636 return Lhs_T::value > Rhs_T::value;
637 }
638 else
639 {
640 return get (lhs_) > get (rhs_);
641 }
642#if defined(__GNUC__)
643#pragma GCC diagnostic pop
644#endif
645 }() }
646 {
647 }
648
661 [[nodiscard]] constexpr
662 operator bool () const
663 {
664 return value_;
665 }
666
679 [[nodiscard]] constexpr auto
680 lhs (void) const
681 {
682 return get (lhs_);
683 }
684 [[nodiscard]] constexpr auto
685
698 rhs (void) const
699 {
700 return get (rhs_);
701 }
702
706 const Lhs_T lhs_{};
707
711 const Rhs_T rhs_{};
712
716 const bool value_{};
717 };
718
719 // Deduction guide.
720 template <typename Lhs_T, typename Rhs_T>
721 gt_ (const Lhs_T&, const Rhs_T&) -> gt_<Lhs_T, Rhs_T>;
722
723 // ------------------------------------------------------------------------
724
750 template <class Lhs_T, class Rhs_T>
752 {
766 constexpr ge_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
767 : lhs_{ lhs }, rhs_{ rhs },
768 value_{ [&]
769 {
770 using std::operator>=;
771
772#if defined(__GNUC__)
773#pragma GCC diagnostic push
774#pragma GCC diagnostic ignored "-Wconversion"
775#pragma GCC diagnostic ignored "-Wdouble-promotion"
776#pragma GCC diagnostic ignored "-Wsign-compare"
777#if defined(__clang__)
778#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
779#pragma clang diagnostic ignored "-Wpedantic"
780#endif
781#endif
784 {
785 return Lhs_T::value >= Rhs_T::value;
786 }
787 else
788 {
789 return get (lhs_) >= get (rhs_);
790 }
791#if defined(__GNUC__)
792#pragma GCC diagnostic pop
793#endif
794 }() }
795 {
796 }
797
810 [[nodiscard]] constexpr
811 operator bool () const
812 {
813 return value_;
814 }
815
828 [[nodiscard]] constexpr auto
829 lhs (void) const
830 {
831 return get (lhs_);
832 }
833
846 [[nodiscard]] constexpr auto
847 rhs (void) const
848 {
849 return get (rhs_);
850 }
851
855 const Lhs_T lhs_{};
856
860 const Rhs_T rhs_{};
861
865 const bool value_{};
866 };
867
868 // Deduction guide.
869 template <typename Lhs_T, typename Rhs_T>
870 ge_ (const Lhs_T&, const Rhs_T&) -> ge_<Lhs_T, Rhs_T>;
871
872 // ------------------------------------------------------------------------
873
899 template <class Lhs_T, class Rhs_T>
901 {
913 constexpr lt_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
914 : lhs_{ lhs }, rhs_{ rhs },
915 value_{ [&]
916 {
917 using std::operator<;
918
919#if defined(__GNUC__)
920#pragma GCC diagnostic push
921#pragma GCC diagnostic ignored "-Wconversion"
922#pragma GCC diagnostic ignored "-Wdouble-promotion"
923#pragma GCC diagnostic ignored "-Wsign-compare"
924#if defined(__clang__)
925#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
926#pragma clang diagnostic ignored "-Wpedantic"
927#endif
928#endif
931 {
932 return Lhs_T::value < Rhs_T::value;
933 }
934 else
935 {
936 return get (lhs_) < get (rhs_);
937 }
938#if defined(__GNUC__)
939#pragma GCC diagnostic pop
940#endif
941 }() }
942 {
943 }
944
957 [[nodiscard]] constexpr
958 operator bool () const
959 {
960 return value_;
961 }
962
975 [[nodiscard]] constexpr auto
976 lhs (void) const
977 {
978 return get (lhs_);
979 }
980
993 [[nodiscard]] constexpr auto
994 rhs (void) const
995 {
996 return get (rhs_);
997 }
998
999 private:
1003 const Lhs_T lhs_{};
1004
1008 const Rhs_T rhs_{};
1009
1013 const bool value_{};
1014 };
1015
1016 // Deduction guide.
1017 template <typename Lhs_T, typename Rhs_T>
1018 lt_ (const Lhs_T&, const Rhs_T&) -> lt_<Lhs_T, Rhs_T>;
1019
1020 // ------------------------------------------------------------------------
1021
1047 template <class Lhs_T, class Rhs_T>
1049 {
1063 constexpr le_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1064 : lhs_{ lhs }, rhs_{ rhs },
1065 value_{ [&]
1066 {
1067 using std::operator<=;
1068
1069#if defined(__GNUC__)
1070#pragma GCC diagnostic push
1071#pragma GCC diagnostic ignored "-Wconversion"
1072#pragma GCC diagnostic ignored "-Wdouble-promotion"
1073#pragma GCC diagnostic ignored "-Wsign-compare"
1074#if defined(__clang__)
1075#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
1076#pragma clang diagnostic ignored "-Wpedantic"
1077#endif
1078#endif
1081 {
1082 return Lhs_T::value <= Rhs_T::value;
1083 }
1084 else
1085 {
1086 return get (lhs_) <= get (rhs_);
1087 }
1088#if defined(__GNUC__)
1089#pragma GCC diagnostic pop
1090#endif
1091 }() }
1092 {
1093 }
1094
1107 [[nodiscard]] constexpr
1108 operator bool () const
1109 {
1110 return value_;
1111 }
1112
1125
1126 [[nodiscard]] constexpr auto
1127 lhs (void) const
1128 {
1129 return get (lhs_);
1130 }
1131
1144 [[nodiscard]] constexpr auto
1145 rhs (void) const
1146 {
1147 return get (rhs_);
1148 }
1149
1153 const Lhs_T lhs_{};
1154
1158 const Rhs_T rhs_{};
1159
1163 const bool value_{};
1164 };
1165
1166 // Deduction guide.
1167 template <typename Lhs_T, typename Rhs_T>
1168 le_ (const Lhs_T&, const Rhs_T&) -> le_<Lhs_T, Rhs_T>;
1169
1170 // ------------------------------------------------------------------------
1171
1196 template <class Lhs_T, class Rhs_T>
1198 {
1210 constexpr and_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1211 : lhs_{ lhs }, rhs_{ rhs },
1212 value_{ static_cast<bool> (lhs) and static_cast<bool> (rhs) }
1213 {
1214 }
1215
1227 [[nodiscard]] constexpr
1228 operator bool () const
1229 {
1230 return value_;
1231 }
1232
1245 [[nodiscard]] constexpr auto
1246 lhs (void) const
1247 {
1248 return get (lhs_);
1249 }
1250
1263 [[nodiscard]] constexpr auto
1264 rhs (void) const
1265 {
1266 return get (rhs_);
1267 }
1268
1272 const Lhs_T lhs_{};
1273
1277 const Rhs_T rhs_{};
1278
1282 const bool value_{};
1283 };
1284
1285 // Deduction guide.
1286 template <typename Lhs_T, typename Rhs_T>
1287 and_ (const Lhs_T&, const Rhs_T&) -> and_<Lhs_T, Rhs_T>;
1288
1289 // ------------------------------------------------------------------------
1290
1315 template <class Lhs_T, class Rhs_T>
1317 {
1329 constexpr or_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1330 : lhs_{ lhs }, rhs_{ rhs },
1331 value_{ static_cast<bool> (lhs) or static_cast<bool> (rhs) }
1332 {
1333 }
1334
1346 [[nodiscard]] constexpr
1347 operator bool () const
1348 {
1349 return value_;
1350 }
1351
1364 [[nodiscard]] constexpr auto
1365 lhs (void) const
1366 {
1367 return get (lhs_);
1368 }
1369
1382 [[nodiscard]] constexpr auto
1383 rhs (void) const
1384 {
1385 return get (rhs_);
1386 }
1387
1391 const Lhs_T lhs_{};
1392
1396 const Rhs_T rhs_{};
1397
1401 const bool value_{};
1402 };
1403
1404 // Deduction guide.
1405 template <typename Lhs_T, typename Rhs_T>
1406 or_ (const Lhs_T&, const Rhs_T&) -> or_<Lhs_T, Rhs_T>;
1407
1408 // ------------------------------------------------------------------------
1409
1433 template <class T>
1435 {
1446 explicit constexpr not_ (const T& t = {})
1447 : t_{ t }, value_{ not static_cast<bool> (t) }
1448 {
1449 }
1450
1462 [[nodiscard]] constexpr
1463 operator bool () const
1464 {
1465 return value_;
1466 }
1467
1479 [[nodiscard]] constexpr auto
1480 value () const
1481 {
1482 return get (t_);
1483 }
1484
1488 const T t_{};
1489
1493 const bool value_{};
1494 };
1495
1496 // Deduction guide.
1497 template <typename T>
1498 not_ (const T&) -> not_<T>;
1499
1500 // ------------------------------------------------------------------------
1501
1502#if defined(__cpp_exceptions)
1503
1530 template <class Callable_T, class Exception_T = void>
1532 {
1544 constexpr explicit throws_ (const Callable_T& func)
1545 : value_{ [&func]
1546 {
1547 try
1548 {
1549 func ();
1550 }
1551 catch (const Exception_T&)
1552 {
1553 return true;
1554 }
1555 catch (...)
1556 {
1557 return false;
1558 }
1559 return false;
1560 }() }
1561 {
1562 }
1563
1576 [[nodiscard]] constexpr
1577 operator bool () const
1578 {
1579 return value_;
1580 }
1581
1585 const bool value_{};
1586 };
1587
1588 // ------------------------------------------------------------------------
1589
1614 template <class Callable_T>
1615 struct throws_<Callable_T, void> : type_traits::op
1616 {
1628 constexpr explicit throws_ (const Callable_T& func)
1629 : value_{ [&func]
1630 {
1631 try
1632 {
1633 func ();
1634 }
1635 catch (...)
1636 {
1637 return true;
1638 }
1639 return false;
1640 }() }
1641 {
1642 }
1643
1655 [[nodiscard]] constexpr
1656 operator bool () const
1657 {
1658 return value_;
1659 }
1660
1664 const bool value_{};
1665 };
1666
1667 // ------------------------------------------------------------------------
1668
1693 template <class Callable_T>
1695 {
1706 constexpr explicit nothrow_ (const Callable_T& func)
1707 : value_{ [&func]
1708 {
1709 try
1710 {
1711 func ();
1712 }
1713 catch (...)
1714 {
1715 return false;
1716 }
1717 return true;
1718 }() }
1719 {
1720 }
1721
1733 [[nodiscard]] constexpr
1734 operator bool () const
1735 {
1736 return value_;
1737 }
1738
1742 const bool value_{};
1743 };
1744
1745#endif
1746
1747 // ------------------------------------------------------------------------
1748
1768 {
1769 public:
1777 const reflection::source_location location);
1778
1783
1792 template <class T>
1793 auto&
1794 operator<< (const T& msg);
1795
1808 [[nodiscard]] constexpr bool
1809 value () const
1810 {
1811 return value_;
1812 }
1813
1814 protected:
1818 bool value_{};
1819
1824 bool abort_ = false;
1825
1830
1835 std::string message_{};
1836 };
1837
1838 // ------------------------------------------------------------------------
1839
1858 template <class Expr_T>
1860 {
1861 public:
1874 constexpr explicit deferred_reporter (
1875 const Expr_T& expr, bool abort,
1876 const reflection::source_location& location);
1877
1882
1883 protected:
1887 const Expr_T expr_{};
1888 };
1889
1890 // ------------------------------------------------------------------------
1891 } // namespace detail
1892
1893 // --------------------------------------------------------------------------
1894} // namespace micro_os_plus::micro_test_plus
1895
1896#if defined(__GNUC__)
1897#pragma GCC diagnostic pop
1898#endif
1899
1900// ----------------------------------------------------------------------------
1901
1902#endif // __cplusplus
1903
1904// ----------------------------------------------------------------------------
1905
1906#endif // MICRO_TEST_PLUS_DETAIL_H_
1907
1908// ----------------------------------------------------------------------------
const reflection::source_location location_
Stores the source location associated with the report.
Definition detail.h:1829
constexpr bool value() const
Retrieves the result value.
Definition detail.h:1809
std::string message_
String to collect the expectation message passed via operator<<().
Definition detail.h:1835
bool abort_
Indicates whether the reporting should abort further processing.
Definition detail.h:1824
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:1818
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:1887
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:1198
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1264
const bool value_
Stores the result of the logical AND operation.
Definition detail.h:1282
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1277
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1246
constexpr and_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a logical AND comparator for the given operands.
Definition detail.h:1210
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1272
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:382
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:390
const bool value_
Stores the result of the equality comparison.
Definition detail.h:400
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:364
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:395
Greater than or equal comparator struct template.
Definition detail.h:752
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:855
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:847
constexpr ge_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a greater than or equal comparator for the given operands.
Definition detail.h:766
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:860
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:829
const bool value_
Stores the result of the greater than or equal comparison.
Definition detail.h:865
Greater than comparator struct template.
Definition detail.h:605
constexpr gt_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a greater than comparator for the given operands.
Definition detail.h:617
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:680
const bool value_
Stores the result of the greater than comparison.
Definition detail.h:716
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:698
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:706
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:711
Less than or equal comparator struct template.
Definition detail.h:1049
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1145
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1153
const bool value_
Stores the result of the less than or equal comparison.
Definition detail.h:1163
constexpr le_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a less than or equal comparator for the given operands.
Definition detail.h:1063
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1158
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1127
Less than comparator struct template.
Definition detail.h:901
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1003
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:976
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:994
const bool value_
Stores the result of the less than comparison.
Definition detail.h:1013
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1008
constexpr lt_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a less than comparator for the given operands.
Definition detail.h:913
Non-equality comparator struct template.
Definition detail.h:438
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:564
constexpr ne_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a non-equality comparator for the given operands.
Definition detail.h:450
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:551
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:533
const bool value_
Stores the result of the non-equality comparison.
Definition detail.h:569
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:559
Logical NOT comparator struct template.
Definition detail.h:1435
constexpr auto value() const
Retrieves the value of the operand.
Definition detail.h:1480
constexpr not_(const T &t={})
Constructs a logical NOT comparator for the given operand.
Definition detail.h:1446
const bool value_
Stores the result of the logical NOT operation.
Definition detail.h:1493
constexpr nothrow_(const Callable_T &func)
Constructs a nothrow checking operator for the given callable.
Definition detail.h:1706
const bool value_
Stores the result of the nothrow check.
Definition detail.h:1742
Logical OR comparator struct template.
Definition detail.h:1317
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1391
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1396
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1383
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1365
constexpr or_(const Lhs_T &lhs={}, const Rhs_T &rhs={})
Constructs a logical OR comparator for the given operands.
Definition detail.h:1329
const bool value_
Stores the result of the logical OR operation.
Definition detail.h:1401
constexpr throws_(const Callable_T &func)
Constructs an exception checking operator for the given callable.
Definition detail.h:1628
const bool value_
Stores the result of the exception check.
Definition detail.h:1664
constexpr throws_(const Callable_T &func)
Constructs an exception checking operator for the given callable.
Definition detail.h:1544
const bool value_
Stores the result of the exception check.
Definition detail.h:1585
Empty base struct for all operator types.