less.pass.cpp 658 B

1234567891011121314151617181920212223242526
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <functional>
  10. // less
  11. #include <functional>
  12. #include <type_traits>
  13. #include <cassert>
  14. int main()
  15. {
  16. typedef std::less<int> F;
  17. const F f = F();
  18. static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
  19. assert(!f(36, 36));
  20. assert(!f(36, 6));
  21. assert(f(6, 36));
  22. }