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/detected_or.qbk b/doc/detected_or.qbk
new file mode 100644
index 0000000..e036fd0
--- /dev/null
+++ b/doc/detected_or.qbk
@@ -0,0 +1,45 @@
+[/
+Copyright 2018 Glen Joseph Fernandes
+<glenjofe -at- gmail.com>
+
+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:detected_or detected_or]
+
+    template<class Default, template<class...> class Op, class... Args>
+    using detected_or = __below;
+
+    template<class Default, template<class...> class Op, class... Args>
+    using detected_or_t = typename detected_or<Default, Op, Args...>::type;
+
+__alias An unspecified type with two public member type definitions:
+
+* `value_t` is __true_type if `Op<Args...>` is a valid template-id, otherwise
+  __false_type
+* `type` is `Op<Args...>` if it is a valid template-id, otherwise `Default`
+
+__std_paper [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf N4502]
+
+__compat Requires C++11 variadic templates and C++11 template aliases.
+
+__header `#include <boost/type_traits/detected_or.hpp>`
+
+__examples
+
+Suppose we wish to declare a type that represents the difference between two values of type T, it should be
+T::difference_type if such a type exists, or std::ptrdiff_t otherwise:
+
+    template<class T>
+    using difference_t = typename T::difference_type;
+
+    template<class T>
+    using difference_type = boost::detected_or_t<std::ptrdiff_t, difference_t, T>;
+
+Now the type `difference_type<T>` gives us what we need.
+
+See also: __is_detected, __is_detected_convertible, __is_detected_exact.
+
+[endsect]