]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/is_final.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / is_final.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright (c) 2014 Agustin Berge
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_final is_final]
9 template <class T>
10 struct is_final : public __tof {};
11
12__inherit If T is a (possibly cv-qualified) class type declared with the final
13specifier type then inherits from __true_type, otherwise inherits from __false_type.
14Currently requires some kind of compiler support.
15
16__std_ref 9p3.
17
18__compat Without (some as yet unspecified) help from the compiler, we cannot detect
19class types declared with the final specifier using only standard C++,
20as a result this type will never inherit from __true_type, unless the user explicitly
21specializes the template for their user-defined final class types, or unless the compiler
22supplies some unspecified intrinsic that implements this functionality.
23Currently (June 2015) compilers more recent than GCC-4.7, Oracle-12.4, and Clang
24have the necessary compiler __intrinsics to ensure that this
25trait "just works". You may also test to see if the necessary __intrinsics are available
26by checking to see if the macro `BOOST_IS_FINAL` is defined.
27
28__header ` #include <boost/type_traits/is_final.hpp>` or ` #include <boost/type_traits.hpp>`
29
30__examples
31
32Given `struct my_final final {};` then:
33
34[:`is_final<my_final>` inherits from `__true_type`.]
35
36[:`is_final<const my_final>::type` is the type `__true_type`.]
37
38[:`is_final<my_final>::value` is an integral constant
39expression that evaluates to /true/.]
40
41[:`is_final<my_final*>::value` is an integral constant
42expression that evaluates to /false/.]
43
44[:`is_final<T>::value_type` is the type `bool`.]
45
46[endsect]
47