Skip to content

Commit

Permalink
Better code wrap on wide screen
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Oct 31, 2024
1 parent 55a61a4 commit e481cd5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions trees/uts-002H.tree
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,18 @@ requires [(arguments)] {

template<typename T>
concept MyConcept = requires (T a, T b) { // First case: SFINAE constrains
a + b; // Req. 1 - support add operator
a[0]; // Req. 2 - support subscript operator
a.x; // Req. 3 - has "x" data member
a.f(); // Req. 4 - has "f" function member
typename T::type; // Req. 5 - has "type" field
{*a + 1} -> std::convertible_to<float>; // Req. 6 - can be deferred and the sum
// with an integer is convertible
// to float
{a * a} -> std::same_as<int>; // Req. 7 - "a * a" must be valid and
// the result type is "int"
a + b; // Req. 1 - support add operator
a[0]; // Req. 2 - support subscript operator
a.x; // Req. 3 - has "x" data member
a.f(); // Req. 4 - has "f" function member
typename T::type; // Req. 5 - has "type" field

{*a + 1} -> std::convertible_to<float>;// Req. 6 - can be deferred
// and the sum
// with an integer is convertible
// to float
{a * a} -> std::same_as<int>; // Req. 7 - "a * a" must be valid
// and the result type is "int"
};
>>>

Expand Down

0 comments on commit e481cd5

Please sign in to comment.