]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/has_trivial_move_assign.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / has_trivial_move_assign.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright 2007 John Maddock.
3 Copyright 2013 Antony Polukhin.
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt).
7]
8
9[section:has_trivial_move_assign has_trivial_move_assign]
10 template <class T>
11 struct has_trivial_move_assign : public __tof {};
12
13__inherit If T is a (possibly cv-qualified) type with a trivial move assignment-operator
14then inherits from __true_type, otherwise inherits from __false_type.
15
16If a type has a trivial move assignment-operator then the operator has the same effect
17as copying the bits of one object to the other:
18calls to the operator can be safely replaced with a call to `memcpy`.
19
20__compat Without some (as yet unspecified) help from the compiler,
21has_trivial_move_assign will never report that a user-defined class or struct has a
22trivial move assign; this is always safe, if possibly sub-optimal.
23In addition, in order to correctly handle private or deleted move assignment
24operators then c++11's `decltype` is required.
25Currently (June 2015) compilers that have the necessary __intrinsics to ensure that this
26trait "just works" include Clang, GCC-5.1 and MSVC-12.0.
27You may also test to see if the necessary __intrinsics are available
28by checking to see if the macro `BOOST_HAS_TRIVIAL_MOVE_ASSIGN` is defined.
29
30
31__header ` #include <boost/type_traits/has_trivial_move_assign.hpp>` or ` #include <boost/type_traits.hpp>`
32
33__examples
34
35[:`has_trivial_move_assign<int>` inherits from `__true_type`.]
36
37[:`has_trivial_move_assign<char*>::type` is the type `__true_type`.]
38
39[:`has_trivial_move_assign<int (*)(long)>::value` is an integral constant
40expression that evaluates to /true/.]
41
42[:`has_trivial_move_assign<MyClass>::value` is an integral constant
43expression that evaluates to /false/.]
44
45[:`has_trivial_move_assign<T>::value_type` is the type `bool`.]
46
47[endsect]
48