is_detected_exact.qbk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. [/
  2. Copyright 2018 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under the Boost Software License,
  5. Version 1.0. (See accompanying file LICENSE_1_0.txt
  6. or copy at http://www.boost.org/LICENSE_1_0.txt).
  7. ]
  8. [section:is_detected_exact is_detected_exact]
  9. template<class Expected, template<class...> class Op, class... Args>
  10. using is_detected_exact = is_same<Expected, detected_t<Op, Args...> >;
  11. template<class Expected, template<class...> class Op, class... Args>
  12. constexpr bool is_detected_exact_v = is_detected_exact<Op, Args...>::value;
  13. __std_paper [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf N4502]
  14. __compat Requires C++11 variadic templates and C++11 template aliases.
  15. __header `#include <boost/type_traits/is_detected_exact.hpp>`
  16. The type `is_detected_exact<To, Op, Args>` is an alias for __true_type if the result of
  17. `Op<Args>` is type `To`. Otherwise it's the type __false_type;
  18. __examples
  19. template<class T>
  20. using difference_t = typename T::difference_type;
  21. static_assert(boost::is_detected_exact_v<std::ptrdiff_t, difference_t, T>);
  22. See also: __is_detected, __is_detected_convertible.
  23. [endsect]