Namespaces
Variants
Views
Actions

std::experimental::ranges::Swappable, std::experimental::ranges::SwappableWith

From cppreference.com
< cpp‎ | experimental‎ | ranges
 
 
Technical specifications
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals 2 TS)
Extensions for parallelism (parallelism TS)
Extensions for concurrency (concurrency TS)
Concepts (concepts TS)
Ranges (ranges TS)
Special mathematical functions (special math TR)
 
 
Concepts library
Core language concepts
                              
SwappableSwappableWith
Object concepts
                              
                              
Comparison concepts
Callable concepts
                                        
                              
URNG concept
 
template < class T >

concept bool Swappable =
  requires(T& a, T& b) {
    ranges::swap(a, b);

  };
(1) (ranges TS)
template < class T, class U >

concept bool SwappableWith =
  ranges::CommonReference<
    const std::remove_reference_t<T>&,
    const std::remove_reference_t<U>&> &&
  requires(T&& t, U&& u) {
    ranges::swap(std::forward<T>(t), std::forward<T>(t));
    ranges::swap(std::forward<U>(u), std::forward<U>(u));
    ranges::swap(std::forward<T>(t), std::forward<U>(u));
    ranges::swap(std::forward<U>(u), std::forward<T>(t));

  };
(2) (ranges TS)