Lines Matching refs:forward
12 // test forward
32 return std::forward<int&>(x) == 42
33 && std::forward<int>(x) == 42
34 && std::forward<const int&>(x) == 42
35 && std::forward<const int>(x) == 42
36 && std::forward<int&&>(x) == 42
37 && std::forward<const int&&>(x) == 42
38 && std::forward<const int&>(cx) == 101
39 && std::forward<const int>(cx) == 101;
53 static_assert(std::is_same<decltype(std::forward<A&>(a)), A&>::value, "");
54 static_assert(std::is_same<decltype(std::forward<A>(a)), A&&>::value, "");
55 static_assert(std::is_same<decltype(std::forward<A>(source())), A&&>::value, "");
56 static_assert(noexcept(std::forward<A&>(a)), "");
57 static_assert(noexcept(std::forward<A>(a)), "");
58 static_assert(noexcept(std::forward<A>(source())), "");
60 static_assert(std::is_same<decltype(std::forward<const A&>(a)), const A&>::value, "");
61 static_assert(std::is_same<decltype(std::forward<const A>(a)), const A&&>::value, "");
62 static_assert(std::is_same<decltype(std::forward<const A>(source())), const A&&>::value, "");
63 static_assert(noexcept(std::forward<const A&>(a)), "");
64 static_assert(noexcept(std::forward<const A>(a)), "");
65 static_assert(noexcept(std::forward<const A>(source())), "");
67 static_assert(std::is_same<decltype(std::forward<const A&>(ca)), const A&>::value, "");
68 static_assert(std::is_same<decltype(std::forward<const A>(ca)), const A&&>::value, "");
69 static_assert(std::is_same<decltype(std::forward<const A>(csource())), const A&&>::value, "");
70 static_assert(noexcept(std::forward<const A&>(ca)), "");
71 static_assert(noexcept(std::forward<const A>(ca)), "");
72 static_assert(noexcept(std::forward<const A>(csource())), "");
76 constexpr int i2 = std::forward<int>(42);
77 static_assert(std::forward<int>(42) == 42, "");
78 static_assert(std::forward<const int&>(i2) == 42, "");
83 // Test that std::forward is constexpr in C++11. This is an extension
86 constexpr int i2 = std::forward<int>(42);
87 static_assert(std::forward<int>(42) == 42, "" );
88 static_assert(std::forward<const int&>(i2) == 42, "");