is_bind_expression.pass.cpp 772 B

1234567891011121314151617181920212223242526272829303132
  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. // template<class T> struct is_bind_expression
  11. #include <functional>
  12. template <bool Expected, class T>
  13. void
  14. test(const T&)
  15. {
  16. static_assert(std::is_bind_expression<T>::value == Expected, "");
  17. }
  18. struct C {};
  19. int main()
  20. {
  21. test<true>(std::bind(C()));
  22. test<true>(std::bind(C(), std::placeholders::_2));
  23. test<true>(std::bind<int>(C()));
  24. test<false>(1);
  25. test<false>(std::placeholders::_2);
  26. }