]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/is_base_of.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / is_base_of.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright 2007 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_base_of is_base_of]
9
10 template <class Base, class Derived>
11 struct is_base_of : public __tof {};
12
13__inherit If Base is base class of type Derived or if both types are the same
14class type then inherits from __true_type,
15otherwise inherits from __false_type.
16
17This template will detect non-public base classes, and ambiguous base classes.
18It also detects indirect base classes - which is to say __is_base_of<B, D> inherits
19from __true_type if B is located anywhere in the inheritance tree of D.
20
21Note that `is_base_of<X,X>` will inherit from __true_type if X is a class type.
22This is a change in behaviour
23from Boost-1.39.0 in order to track the emerging C++0x standard.
24
25Types `Base` and `Derived` must not be incomplete types.
26
27__std_ref 10.
28
29__header ` #include <boost/type_traits/is_base_of.hpp>` or ` #include <boost/type_traits.hpp>`
30
31[all_compilers]
32
33__examples
34
35[:Given: ` class Base{}; class Derived : public Base{};` ]
36
37[:`is_base_of<Base, Derived>` inherits from `__true_type`.]
38
39[:`is_base_of<Base, Derived>::type` is the type `__true_type`.]
40
41[:`is_base_of<Base, Derived>::value` is an integral constant
42expression that evaluates to /true/.]
43
44[:`is_base_of<Base, Base>::value` is an integral constant
45expression that evaluates to /true/: a class is regarded as it's own base.]
46
47[:`is_base_of<T, T>::value_type` is the type `bool`.]
48
49[endsect]
50
51
52