]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/is_constructible.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / doc / is_constructible.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright 2015 John Maddock.
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
8[section:is_constructible is_constructible]
9
10 template <class T, class... Args>
11 struct is_constructible : public __tof {};
12
13__inherit If `T` can be constructed from `Args`,
14then inherits from __true_type, otherwise inherits from __false_type. Type `T`
15must be a complete type.
16
17Formally the trait answers the question, is the expression:
18
19 T t(std::declval<Args>()...);
20
21valid?
22
23There are a number of important special cases for this trait:
24
25 is_constructible<T>::value
26
27Indicates whether `T` is default constructible, while:
28
29 is_constructible<T, const T&>::value
30
31Indicates whether `T` is copy-constructible, and:
32
33 is_constructible<T, T>::value
34
35Indicates whether `T` is move-constructible.
36
37
38__compat This trait requires the C++11 features `decltype` variadic templates and SFINAE-expression support for full support.
39While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case.
40
41__header ` #include <boost/type_traits/is_copy_constructible.hpp>` or ` #include <boost/type_traits.hpp>`
42
43[endsect]
44