GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::ranges::is_swappable_with,std::experimental::ranges::is_swappable,(3) C++ Standard Libary std::experimental::ranges::is_swappable_with,std::experimental::ranges::is_swappable,(3)

std::experimental::ranges::is_swappable_with,std::experimental::ranges::is_swappable, - std::experimental::ranges::is_swappable_with,std::experimental::ranges::is_swappable,


std::experimental::ranges::is_nothrow_swappable


Defined in header <experimental/ranges/type_traits>
template <class T, class U> (1) (ranges TS)
struct is_swappable_with;
template <class T> (2) (ranges TS)
struct is_swappable;
template <class T, class U> (3) (ranges TS)
struct is_nothrow_swappable_with;
template <class T> (4) (ranges TS)
struct is_nothrow_swappable;


1) If the expressions ranges::swap(std::declval<T>(), std::declval<U>()) and
ranges::swap(std::declval<U>(), std::declval<T>()) are both well-formed when treated
as an unevaluated operand, provides the member constant value equal true. Otherwise,
value is false. Access checks are performed as if from a context unrelated to either
type.
2) If T is not a referenceable type (i.e., possibly cv-qualified void or a function
type with a cv-qualifier-seq or a ref-qualifier), provides a member constant value
equal to false. Otherwise, provides a member constant value equal to
ranges::is_swappable_with<T&, T&>::value.
3) Same as (1), but evaluations of both expressions from (1) are known not to throw
exceptions.
4) Same as (2), but uses is_nothrow_swappable_with.


T and U shall each be a complete type, (possibly cv-qualified) void, or an array of
unknown bound. Otherwise, the behavior is undefined.


Helper variable templates


template <class T, class U> (1) (ranges TS)
constexpr bool is_swappable_with_v = is_swappable_with<T, U>::value;
template <class T> (2) (ranges TS)
constexpr bool is_swappable_v = is_swappable<T>::value;
template <class T, class U>
constexpr bool is_nothrow_swappable_with_v = (3) (ranges TS)
is_nothrow_swappable_with<T, U>::value;
template <class T>
constexpr bool is_nothrow_swappable_v = (4) (ranges TS)
is_nothrow_swappable<T>::value;

Inherited from std::integral_constant


value true if T is swappable with U , false otherwise
[static] (public static member constant)


operator bool converts the object to bool, returns value
(public member function)
operator() returns value
(C++14) (public member function)


Type Definition
value_type bool
type std::integral_constant<bool, value>


This trait does not check anything outside the immediate context of the swap
expressions: if the use of T or U would trigger template specializations, generation
of implicitly-defined special member functions etc, and those have errors, the
actual swap may not compile even if ranges::is_swappable_with<T,U>::value compiles
and evaluates to true.


This section is incomplete
Reason: no example


Swappable specifies that a type can be swapped or that two types can
SwappableWith be swapped with each other
(concept)
is_swappable_with
is_swappable
is_nothrow_swappable_with checks if objects of a type can be swapped with objects of
is_nothrow_swappable same or different type
(C++17) (class template)
(C++17)
(C++17)
(C++17)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.