]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | /* |
2 | Copyright 2017-2018 Glen Joseph Fernandes | |
92f5a8d4 | 3 | (glenjofe@gmail.com) |
11fdf7f2 TL |
4 | |
5 | Distributed under the Boost Software License, | |
6 | Version 1.0. (See accompanying file LICENSE_1_0.txt | |
7 | or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | ||
10 | #ifndef BOOST_TT_DETAIL_DETECTOR_HPP_INCLUDED | |
11 | #define BOOST_TT_DETAIL_DETECTOR_HPP_INCLUDED | |
12 | ||
13 | #include <boost/type_traits/integral_constant.hpp> | |
14 | #include <boost/type_traits/make_void.hpp> | |
15 | ||
16 | namespace boost { | |
17 | namespace detail { | |
18 | ||
19 | template<class T> | |
20 | using detector_t = typename boost::make_void<T>::type; | |
21 | ||
22 | template<class Default, class, template<class...> class, class...> | |
23 | struct detector { | |
24 | using value_t = boost::false_type; | |
25 | using type = Default; | |
26 | }; | |
27 | ||
28 | template<class Default, template<class...> class Op, class... Args> | |
29 | struct detector<Default, detector_t<Op<Args...> >, Op, Args...> { | |
30 | using value_t = boost::true_type; | |
31 | using type = Op<Args...>; | |
32 | }; | |
33 | ||
34 | } /* detail */ | |
35 | } /* boost */ | |
36 | ||
37 | #endif |