Loading...
Searching...
No Matches
ordered.h
Go to the documentation of this file.
1#ifndef _BBM_ORDERED_BACKBONE_CONCEPT_H_
2#define _BBM_ORDERED_BACKBONE_CONCEPT_H_
3
4/************************************************************************/
5/*! \file ordered.h
6
7 \brief A valid ordering requires that the type has eq, neq, <, >, <=, and =>
8 operators that each return the same type. The return type does not need to
9 be a boolean. == and != must return a boolean.
10*************************************************************************/
11
12namespace bbm {
13 namespace concepts {
14 namespace backbone {
15
16 /*****************************************************************/
17 /*! \brief Comparison operators:
18
19 Requires that the type has eq, neq, <, >, <=, and => operators that
20 each return the same type. The return type does not need to be a
21 boolean. == and != must return a boolean.
22 ******************************************************************/
23 template<typename T>
24 concept ordered = requires(T a, T b)
25 {
26 { a == b } -> std::convertible_to<bool>;
27 { a != b } -> std::convertible_to<bool>;
28 { eq(a,b) };
29 { neq(a,b) } -> std::same_as< decltype(eq(a,b)) >;
30 { a < b } -> std::same_as< decltype(eq(a,b)) >;
31 { a > b } -> std::same_as< decltype(eq(a,b)) >;
32 { a <= b } -> std::same_as< decltype(eq(a,b)) >;
33 { a >= b } -> std::same_as< decltype(eq(a,b)) >;
34 };
35
36 } // end backbone namespac
37 } // end concepts namespace
38} // end bbm namespace
39
40#endif /* _BBM_ORDERED_BACKBONE_CONCEPT_H_ */
Comparison operators:
Definition: ordered.h:24
Random number generator; built on top of Drjit.
Definition: backbone.h:53
Definition: aggregatebsdf.h:29