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

来自cppreference.com
< cpp‎ | experimental‎ | ranges
 
 
技术规范
文件系统库 (文件系统 TS)
库基础 (库基础 TS)
库基础 2 (库基础 TS v2)
并行扩展 (并行 TS)
并发扩展 (并发 TS)
概念 (概念 TS)
范围 (范围 TS)
数学特殊函数 (数学特殊 TR)
 
 
概念库
核心语言概念
                              
SwappableSwappableWith
对象概念
                              
                              
比较概念
可调用概念
                                        
                              
URNG 概念
 
定义于头文件 <experimental/ranges/concepts>
template < class T >

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

  };
(1) (范围 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) (范围 TS)