apply_member_pointer_pmd.cpp 888 B

12345678910111213141516171819202122232425262728293031
  1. /*<-
  2. Copyright (c) 2016 arett Adair
  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. #include <boost/callable_traits/apply_member_pointer.hpp>
  7. #include "test.hpp"
  8. struct foo;
  9. template<typename Input, typename Output>
  10. void test_case() {
  11. assert_same<TRAIT(apply_member_pointer, Input, foo), Output>();
  12. }
  13. int main() {
  14. test_case<int, int foo::*>();
  15. test_case<int &, int foo::*>();
  16. test_case<int const, int const foo::*>();
  17. test_case<int const &, int const foo::*>();
  18. test_case<int volatile, int volatile foo::*>();
  19. test_case<int volatile &, int volatile foo::*>();
  20. //member data - function pointer
  21. test_case<int(* const)(), int(* const foo::*)()>();
  22. test_case<int(* const &)(), int(* const foo::*)()>();
  23. }