Home
last modified time | relevance | path

Searched refs:any_cast (Results 1 – 25 of 25) sorted by relevance

/external/libcxx/test/std/utilities/any/any.nonmembers/any.cast/
Dany_cast_pointer.pass.cpp35 using std::any_cast;
40 static_assert(noexcept(any_cast<int>(&a)), ""); in test_cast_is_noexcept()
43 static_assert(noexcept(any_cast<int>(&ca)), ""); in test_cast_is_noexcept()
49 static_assert(std::is_same<decltype(any_cast<int>(&a)), int*>::value, ""); in test_cast_return_type()
50 static_assert(std::is_same<decltype(any_cast<int const>(&a)), int const*>::value, ""); in test_cast_return_type()
53 static_assert(std::is_same<decltype(any_cast<int>(&ca)), int const*>::value, ""); in test_cast_return_type()
54 static_assert(std::is_same<decltype(any_cast<int const>(&ca)), int const*>::value, ""); in test_cast_return_type()
60 assert(nullptr == any_cast<int>(a)); in test_cast_nullptr()
61 assert(nullptr == any_cast<int const>(a)); in test_cast_nullptr()
64 assert(nullptr == any_cast<int>(ca)); in test_cast_nullptr()
[all …]
Dany_cast_reference.pass.cpp40 using std::any_cast;
47 static_assert(!noexcept(any_cast<int>(static_cast<any&>(a))), ""); in test_cast_is_not_noexcept()
48 static_assert(!noexcept(any_cast<int>(static_cast<any const&>(a))), ""); in test_cast_is_not_noexcept()
49 static_assert(!noexcept(any_cast<int>(static_cast<any &&>(a))), ""); in test_cast_is_not_noexcept()
55 static_assert(std::is_same<decltype(any_cast<int>(a)), int>::value, ""); in test_cast_return_type()
56 static_assert(std::is_same<decltype(any_cast<int const>(a)), int>::value, ""); in test_cast_return_type()
57 static_assert(std::is_same<decltype(any_cast<int&>(a)), int&>::value, ""); in test_cast_return_type()
58 static_assert(std::is_same<decltype(any_cast<int const&>(a)), int const&>::value, ""); in test_cast_return_type()
60 static_assert(std::is_same<decltype(any_cast<int&&>(a)), int&&>::value, ""); in test_cast_return_type()
61 static_assert(std::is_same<decltype(any_cast<int const&&>(a)), int const&&>::value, ""); in test_cast_return_type()
[all …]
Dreference_types.fail.cpp23 using std::any_cast;
30 any_cast<int &>(&a); // expected-note {{requested here}} in main()
33 any_cast<int &&>(&a); // expected-note {{requested here}} in main()
36 any_cast<int const &>(&a); // expected-note {{requested here}} in main()
39 any_cast<int const&&>(&a); // expected-note {{requested here}} in main()
44 any_cast<int &>(&a2); // expected-note {{requested here}} in main()
47 any_cast<int &&>(&a2); // expected-note {{requested here}} in main()
50 any_cast<int const &>(&a2); // expected-note {{requested here}} in main()
53 any_cast<int const &&>(&a2); // expected-note {{requested here}} in main()
Dany_cast_request_invalid_value_category.fail.cpp23 using std::any_cast;
34 any_cast<TestType &>(a); // expected-note {{requested here}} in test_const_lvalue_cast_request_non_const_lvalue()
39 any_cast<int&>(a2); // expected-note {{requested here}} in test_const_lvalue_cast_request_non_const_lvalue()
46 any_cast<TestType &&>(a); // expected-note {{requested here}} in test_lvalue_any_cast_request_rvalue()
50 any_cast<int&&>(a2); // expected-note {{requested here}} in test_lvalue_any_cast_request_rvalue()
58 any_cast<TestType &>(std::move(a)); // expected-note {{requested here}} in test_rvalue_any_cast_request_lvalue()
62 any_cast<int&>(42); in test_rvalue_any_cast_request_lvalue()
Dconst_correctness.fail.cpp31 using std::any_cast; in main()
37 any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}} in main()
41 any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}} in main()
45 any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}} in main()
49 any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}} in main()
Dnot_copy_constructible.fail.cpp28 using std::any_cast;
51 any_cast<no_copy>(static_cast<any&>(a)); // expected-note {{requested here}} in main()
55 any_cast<no_copy>(static_cast<any const&>(a)); // expected-note {{requested here}} in main()
57 any_cast<no_copy>(static_cast<any &&>(a)); // OK in main()
61 any_cast<no_move>(static_cast<any &&>(a)); in main()
/external/swiftshader/third_party/llvm-7.0/llvm/unittests/ADT/
DAnyTest.cpp87 EXPECT_EQ(7, llvm::any_cast<int>(B)); in TEST()
88 EXPECT_EQ(7, llvm::any_cast<int>(B)); in TEST()
90 EXPECT_STREQ("hello", llvm::any_cast<const char *>(D)); in TEST()
91 EXPECT_STREQ("hello", llvm::any_cast<const char *>(D)); in TEST()
93 EXPECT_EQ('x', llvm::any_cast<char>(E)); in TEST()
94 EXPECT_EQ('x', llvm::any_cast<char>(E)); in TEST()
97 EXPECT_EQ(7, llvm::any_cast<int>(F)); in TEST()
98 EXPECT_EQ(7, llvm::any_cast<int>(F)); in TEST()
101 EXPECT_EQ(8, llvm::any_cast<int>(G)); in TEST()
102 EXPECT_EQ(8, llvm::any_cast<int>(G)); in TEST()
[all …]
/external/swiftshader/third_party/llvm-7.0/llvm/include/llvm/ADT/
DAny.h92 template <class T> friend T any_cast(const Any &Value);
93 template <class T> friend T any_cast(Any &Value);
94 template <class T> friend T any_cast(Any &&Value);
95 template <class T> friend const T *any_cast(const Any *Value);
96 template <class T> friend T *any_cast(Any *Value);
113 template <class T> T any_cast(const Any &Value) { in any_cast() function
116 return static_cast<T>(*any_cast<U>(&Value)); in any_cast()
119 template <class T> T any_cast(Any &Value) { in any_cast() function
122 return static_cast<T>(*any_cast<U>(&Value)); in any_cast()
125 template <class T> T any_cast(Any &&Value) { in any_cast() function
[all …]
/external/libcxx/test/std/utilities/any/any.class/any.modifiers/
Demplace.pass.cpp34 using std::any_cast;
55 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type()
71 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type()
87 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type()
108 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type_tracked()
118 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type_tracked()
129 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type_tracked()
140 assert(&v == std::any_cast<Type>(&a)); in test_emplace_type_tracked()
Dreset.pass.cpp32 using std::any_cast; in main()
Dswap.pass.cpp32 using std::any_cast;
/external/libcxx/test/std/utilities/any/any.nonmembers/
Dswap.pass.cpp30 using std::any_cast;
45 assert(any_cast<int>(a1) == 2); in main()
46 assert(any_cast<int>(a2) == 1); in main()
Dmake_any.pass.cpp34 using std::any_cast;
/external/libcxx/include/
Dany69 ValueType any_cast(const any& operand);
71 ValueType any_cast(any& operand);
73 ValueType any_cast(any&& operand);
76 const ValueType* any_cast(const any* operand) noexcept;
78 ValueType* any_cast(any* operand) noexcept;
125 any_cast(any const *) _NOEXCEPT;
129 add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT;
332 any_cast(any const *) _NOEXCEPT;
336 any_cast(any *) _NOEXCEPT;
582 _ValueType any_cast(any const & __v)
[all …]
/external/libcxx/test/std/utilities/any/any.class/any.cons/
Din_place_type.pass.cpp42 using std::any_cast;
124 assert(any_cast<DecayT>(a) == test_func); in test_in_place_type_decayed()
132 assert(any_cast<DecayT>(a) == my_arr); in test_in_place_type_decayed()
139 assert(any_cast<DecayT>(a) == nullptr); in test_in_place_type_decayed()
Dcopy.pass.cpp32 using std::any_cast;
Dmove.pass.cpp34 using std::any_cast;
Dvalue.pass.cpp39 using std::any_cast;
/external/libcxx/test/support/
Dany_helpers.h42 return a.has_value() && std::any_cast<T>(&a) != nullptr; in containsType()
59 assert(any_cast<LastType const>(&a) == nullptr); in assertEmpty()
75 assert(std::any_cast<Type const &>(a).value == value); in assertContains()
84 assert(std::any_cast<Type const &>(a) == value); in assertContains()
97 any_cast<Type&>(a).value = value; in modifyValue()
430 assert(any_cast<Type const &>(a).arg_types == &makeArgumentID<Args...>()); in assertArgsMatch()
Dexperimental_any_helpers.h53 assert(std::experimental::any_cast<LastType const>(&a) == nullptr); in assertEmpty()
62 assert(std::experimental::any_cast<Type const &>(a).value == value);
72 std::experimental::any_cast<Type&>(a).value = value; in modifyValue()
/external/libcxx/test/std/utilities/any/any.class/any.assign/
Dmove.pass.cpp33 using std::any_cast;
Dcopy.pass.cpp34 using std::any_cast;
Dvalue.pass.cpp35 using std::any_cast;
/external/googletest/googlemock/include/gmock/
Dgmock-matchers.h3353 void any_cast() {}
3366 const T* ptr = any_cast<T>(&value);
3370 const T* elem = any_cast<T>(&value);
/external/googletest/googlemock/test/
Dgmock-matchers_test.cc6763 friend const T* any_cast(const SampleAnyType* any) { in any_cast() function