summaryrefslogtreecommitdiff
path: root/boost/type_traits/detail/detector.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/type_traits/detail/detector.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/type_traits/detail/detector.hpp')
-rw-r--r--boost/type_traits/detail/detector.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/boost/type_traits/detail/detector.hpp b/boost/type_traits/detail/detector.hpp
new file mode 100644
index 0000000000..007a4dc8e1
--- /dev/null
+++ b/boost/type_traits/detail/detector.hpp
@@ -0,0 +1,37 @@
+/*
+Copyright 2017-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)
+*/
+
+#ifndef BOOST_TT_DETAIL_DETECTOR_HPP_INCLUDED
+#define BOOST_TT_DETAIL_DETECTOR_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/make_void.hpp>
+
+namespace boost {
+namespace detail {
+
+template<class T>
+using detector_t = typename boost::make_void<T>::type;
+
+template<class Default, class, template<class...> class, class...>
+struct detector {
+ using value_t = boost::false_type;
+ using type = Default;
+};
+
+template<class Default, template<class...> class Op, class... Args>
+struct detector<Default, detector_t<Op<Args...> >, Op, Args...> {
+ using value_t = boost::true_type;
+ using type = Op<Args...>;
+};
+
+} /* detail */
+} /* boost */
+
+#endif