binary_function.pass.cpp 990 B

12345678910111213141516171819202122232425262728
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <functional>
  10. // template <class Arg1, class Arg2, class Result>
  11. // struct binary_function
  12. // {
  13. // typedef Arg1 first_argument_type;
  14. // typedef Arg2 second_argument_type;
  15. // typedef Result result_type;
  16. // };
  17. #include <functional>
  18. #include <type_traits>
  19. int main()
  20. {
  21. static_assert((std::is_same<std::binary_function<int, unsigned, char>::first_argument_type, int>::value), "");
  22. static_assert((std::is_same<std::binary_function<int, unsigned, char>::second_argument_type, unsigned>::value), "");
  23. static_assert((std::is_same<std::binary_function<int, unsigned, char>::result_type, char>::value), "");
  24. }