is_bind_expression.pass.cpp 817 B

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