Squashed 'third_party/boostorg/type_traits/' content from commit 059ed88
Change-Id: I222c604dfa1db194bf53bc6aa1152fb16e83ce06
git-subtree-dir: third_party/boostorg/type_traits
git-subtree-split: 059ed8839da3fecd1e8b62cdc11be006f6346b5e
diff --git a/doc/user_defined.qbk b/doc/user_defined.qbk
new file mode 100644
index 0000000..cb0636b
--- /dev/null
+++ b/doc/user_defined.qbk
@@ -0,0 +1,43 @@
+[/
+ Copyright 2007 John Maddock.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[section:user_defined User Defined Specializations]
+
+Occationally the end user may need to provide their own specialization
+for one of the type traits - typically where intrinsic compiler support
+is required to implement a specific trait fully.
+These specializations should derive from boost::__true_type or boost::__false_type
+as appropriate:
+
+ #include <boost/type_traits/is_pod.hpp>
+ #include <boost/type_traits/is_class.hpp>
+ #include <boost/type_traits/is_union.hpp>
+
+ struct my_pod{};
+ struct my_union
+ {
+ char c;
+ int i;
+ };
+
+ namespace boost
+ {
+ template<>
+ struct __is_pod<my_pod> : public __true_type{};
+
+ template<>
+ struct __is_pod<my_union> : public __true_type{};
+
+ template<>
+ struct __is_union<my_union> : public __true_type{};
+
+ template<>
+ struct __is_class<my_union> : public __false_type{};
+ }
+
+[endsect]
+