modulus.pass.cpp 621 B

123456789101112131415161718192021222324
  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. // modulus
  11. #include <functional>
  12. #include <type_traits>
  13. #include <cassert>
  14. int main()
  15. {
  16. typedef std::modulus<int> F;
  17. const F f = F();
  18. static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
  19. assert(f(36, 8) == 4);
  20. }