]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/user_defined.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / user_defined.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:user_defined User Defined Specializations]
9
10Occationally the end user may need to provide their own specialization
11for one of the type traits - typically where intrinsic compiler support
12is required to implement a specific trait fully.
13These specializations should derive from boost::__true_type or boost::__false_type
14as appropriate:
15
16 #include <boost/type_traits/is_pod.hpp>
17 #include <boost/type_traits/is_class.hpp>
18 #include <boost/type_traits/is_union.hpp>
19
20 struct my_pod{};
21 struct my_union
22 {
23 char c;
24 int i;
25 };
26
27 namespace boost
28 {
29 template<>
30 struct __is_pod<my_pod> : public __true_type{};
31
32 template<>
33 struct __is_pod<my_union> : public __true_type{};
34
35 template<>
36 struct __is_union<my_union> : public __true_type{};
37
38 template<>
39 struct __is_class<my_union> : public __false_type{};
40 }
41
42[endsect]
43