pmd.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. @Copyright Barrett Adair 2015-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. */
  6. #ifndef BOOST_CLBL_TRTS_DETAIL_PMD_HPP
  7. #define BOOST_CLBL_TRTS_DETAIL_PMD_HPP
  8. #include <boost/callable_traits/detail/forward_declarations.hpp>
  9. #include <boost/callable_traits/detail/function.hpp>
  10. #include <boost/callable_traits/detail/traits.hpp>
  11. #include <boost/callable_traits/detail/default_callable_traits.hpp>
  12. #include <boost/callable_traits/detail/utility.hpp>
  13. namespace boost { namespace callable_traits { namespace detail {
  14. template<typename T>
  15. struct pmd : default_callable_traits<T> {};
  16. template<typename D, typename T>
  17. struct pmd<D T::*> : default_callable_traits<> {
  18. static constexpr bool value = true;
  19. using traits = pmd;
  20. using class_type = T;
  21. using invoke_type = T const &;
  22. using type = D T::*;
  23. using function_type = typename std::add_lvalue_reference<D>::type(invoke_type);
  24. using qualified_function_type = D(invoke_type);
  25. using arg_types = std::tuple<invoke_type>;
  26. using non_invoke_arg_types = std::tuple<>;
  27. using return_type = typename std::add_lvalue_reference<D>::type;
  28. template<typename C>
  29. using apply_member_pointer = D C::*;
  30. template<typename R>
  31. using apply_return = R T::*;
  32. template<template<class...> class Container>
  33. using expand_args = Container<invoke_type>;
  34. using is_member_pointer = std::true_type;
  35. };
  36. }}} // namespace boost::callable_traits::detail
  37. #endif