Brian Silverman | 4a2409e | 2018-08-04 23:24:02 -0700 | [diff] [blame^] | 1 | [/ |
| 2 | Copyright 2018 Glen Joseph Fernandes |
| 3 | <glenjofe -at- gmail.com> |
| 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 | [section:is_detected_exact is_detected_exact] |
| 11 | |
| 12 | template<class Expected, template<class...> class Op, class... Args> |
| 13 | using is_detected_exact = is_same<Expected, detected_t<Op, Args...> >; |
| 14 | |
| 15 | template<class Expected, template<class...> class Op, class... Args> |
| 16 | constexpr bool is_detected_exact_v = is_detected_exact<Op, Args...>::value; |
| 17 | |
| 18 | __std_paper [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf N4502] |
| 19 | |
| 20 | __compat Requires C++11 variadic templates and C++11 template aliases. |
| 21 | |
| 22 | __header `#include <boost/type_traits/is_detected_exact.hpp>` |
| 23 | |
| 24 | The type `is_detected_exact<To, Op, Args>` is an alias for __true_type if the result of |
| 25 | `Op<Args>` is type `To`. Otherwise it's the type __false_type; |
| 26 | |
| 27 | |
| 28 | __examples |
| 29 | |
| 30 | template<class T> |
| 31 | using difference_t = typename T::difference_type; |
| 32 | |
| 33 | static_assert(boost::is_detected_exact_v<std::ptrdiff_t, difference_t, T>); |
| 34 | |
| 35 | See also: __is_detected, __is_detected_convertible. |
| 36 | |
| 37 | [endsect] |