std::experimental::ranges::Relation

From cppreference.com
< cpp‎ | experimental‎ | ranges
 
 
Technical specifications
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
 
 
Concepts library
Core language concepts
                              
Object concepts
                              
                              
Comparison concepts
Callable concepts
                                        
Relation
                              
URNG concept
 
template< class R, class T, class U >

concept bool Relation =
    Predicate<R, T, T> &&
    Predicate<R, U, U> &&
    CommonReference<
        const std::remove_reference_t<T>&,
        const std::remove_reference_t<U>&> &&
    Predicate<R,
        ranges::common_reference_t<
            const std::remove_reference_t<T>&,
            const std::remove_reference_t<U>&>,
        ranges::common_reference_t<
            const std::remove_reference_t<T>&,
            const std::remove_reference_t<U>&>> &&
    Predicate<R, T, U> &&

    Predicate<R, U, T>;
(1) (ranges TS)

The concept Relation<R, T, U> specifies that R defines a binary relation over the set of expressions whose type and value category are those encoded by either T or U.

Given

  • r, an expression such that decltype((r)) is R,
  • t, an expression such that decltype((t)) is T,
  • u, an expression such that decltype((u)) is U,

and let C be ranges::common_reference_t<const std::remove_reference_t<T>&, const std::remove_reference_t<U>&>,

then Relation<R, T, U> is satisfied only if

  • bool(r(t, u)) == bool(r(C(t), C(u))) and
  • bool(r(u, t)) == bool(r(C(u), C(t))).