blob: 533f4fca82bff085d91b0c2ceb660f3597a536f6 [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
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:is_nothrow_move_constructible is_nothrow_move_constructible]
10
11 template <class T>
12 struct is_nothrow_move_constructible : public __tof {};
13
14__inherit If T is a (possibly cv-qualified) type with a non-throwing move-constructor
15or a type without move-constructor but with non-throwing copy-constructor,
16then inherits from __true_type, otherwise inherits from __false_type. Type `T`
17must be a complete type.
18
19In other words, inherits from __true_type only if expression `T(std::move(variable1))`
20won't throw (`variable1` is a variable of type `T`).
21
22__compat Without some (C++11 noexcept shall work correctly) help from the compiler,
23`is_nothrow_move_constructible` will never report that a class or struct has a
24non-throwing copy-constructor; this is always safe, if possibly sub-optimal.
25Currently (February 2013) MSVC-12.0, Clang and GCC 4.7 have the necessary compiler support to ensure that this
26trait "just works".
27
28__header ` #include <boost/type_traits/is_nothrow_move_constructible.hpp>` or ` #include <boost/type_traits.hpp>`
29
30[endsect]
31