unary_function.pass.cpp 792 B

1234567891011121314151617181920212223242526
  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 Arg, class Result>
  11. // struct unary_function
  12. // {
  13. // typedef Arg argument_type;
  14. // typedef Result result_type;
  15. // };
  16. #include <functional>
  17. #include <type_traits>
  18. int main()
  19. {
  20. static_assert((std::is_same<std::unary_function<unsigned, char>::argument_type, unsigned>::value), "");
  21. static_assert((std::is_same<std::unary_function<unsigned, char>::result_type, char>::value), "");
  22. }