is_nothrow_swappable.qbk 873 B

1234567891011121314151617181920212223242526
  1. [/
  2. Copyright 2017 Peter Dimov
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:is_nothrow_swappable is_nothrow_swappable]
  8. template <class T>
  9. struct is_nothrow_swappable : public __tof {};
  10. __inherit If the expression `swap(declval<T&>(), declval<T&>())` (in a context
  11. where `std::swap` is visible) is valid and non-throwing, inherits from
  12. __true_type, otherwise from __false_type.
  13. __compat This trait requires C++11 for full support. Without C++11 it will
  14. inherit from __true_type for scalar types (including integral, floating point,
  15. enumeration, pointer and pointer-to-member types), and from __false_type for
  16. anything else.
  17. __header ` #include <boost/type_traits/is_nothrow_swappable.hpp>` or ` #include <boost/type_traits.hpp>`
  18. [endsect]