libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

is_bind_expression.pass.cpp (936B)


      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 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // <functional>
     13 
     14 // template<class T> struct is_bind_expression
     15 
     16 #include <functional>
     17 #include "test_macros.h"
     18 
     19 template <bool Expected, class T>
     20 void
     21 test(const T&)
     22 {
     23     static_assert(std::is_bind_expression<T>::value == Expected, "");
     24 #if TEST_STD_VER > 14
     25     static_assert(std::is_bind_expression_v<T> == Expected, "");
     26 #endif
     27 }
     28 
     29 struct C {};
     30 
     31 int main()
     32 {
     33     test<true>(std::bind(C()));
     34     test<true>(std::bind(C(), std::placeholders::_2));
     35     test<true>(std::bind<int>(C()));
     36     test<false>(1);
     37     test<false>(std::placeholders::_2);
     38 }