Home
last modified time | relevance | path

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

123456

/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.helpers/
H A Dlwg3146.pass.cpp25 std::reference_wrapper<int> ri(i); in test()
26 std::reference_wrapper<std::reference_wrapper<int> > rri(ri); in test()
28 ASSERT_SAME_TYPE(decltype(rrj), std::reference_wrapper<std::reference_wrapper<int> >); in test()
33 std::reference_wrapper<int> ri(i); in test()
34 std::reference_wrapper<const std::reference_wrapper<int> > rri(ri); in test()
36 ASSERT_SAME_TYPE(decltype(rrj), std::reference_wrapper<const std::reference_wrapper<int> >); in test()
41 std::reference_wrapper<int> ri(i); in test()
42 std::reference_wrapper<std::reference_wrapper<int> > rri(ri); in test()
44 ASSERT_SAME_TYPE(decltype(rrj), std::reference_wrapper<const std::reference_wrapper<int> >); in test()
49 std::reference_wrapper<int> ri(i); in test()
[all …]
H A Dcref_2.pass.cpp29 std::reference_wrapper<const int> r1 = std::cref(i); in test()
30 std::reference_wrapper<const int> r2 = std::cref(r1); in test()
35 std::reference_wrapper<const adl::A> a1 = std::cref(a); in test()
36 std::reference_wrapper<const adl::A> a2 = std::cref(a1); in test()
/llvm-project/libcxx/include/__functional/
H A Dreference_wrapper.h33 class _LIBCPP_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp> {
47 __enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, int> = 0>
48 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper(_Up&& __u) in reference_wrapper() function
75 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper __y)
83 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, const _Tp& __y)
91 _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(reference_wrapper __x, reference_wrapper<const _Tp> __y)
99 _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(reference_wrapper __x, reference_wrapper __
[all...]
H A Didentity.h39 struct __is_identity<reference_wrapper<__identity> > : true_type {};
41 struct __is_identity<reference_wrapper<const __identity> > : true_type {};
57 struct __is_identity<reference_wrapper<identity> > : true_type {};
59 struct __is_identity<reference_wrapper<const identity> > : true_type {};
/llvm-project/libcxx/test/libcxx/utilities/function.objects/refwrap/
H A Dbinary.pass.cpp58 std::reference_wrapper<functor1> >::value), ""); in main()
60 std::reference_wrapper<functor2> >::value), ""); in main()
62 std::reference_wrapper<functor3> >::value), ""); in main()
64 std::reference_wrapper<functor4> >::value), ""); in main()
66 std::reference_wrapper<C> >::value), ""); in main()
68 std::reference_wrapper<float ()> >::value), ""); in main()
70 std::reference_wrapper<float (int)> >::value), ""); in main()
72 std::reference_wrapper<float (int, int)> >::value), ""); in main()
74 std::reference_wrapper<float(*)()> >::value), ""); in main()
76 std::reference_wrapper<float(*)(int)> >::value), ""); in main()
[all …]
H A Dunary.pass.cpp58 std::reference_wrapper<functor1> >::value), ""); in main()
60 std::reference_wrapper<functor2> >::value), ""); in main()
62 std::reference_wrapper<functor3> >::value), ""); in main()
64 std::reference_wrapper<functor4> >::value), ""); in main()
66 std::reference_wrapper<C> >::value), ""); in main()
68 std::reference_wrapper<float(*)()> >::value), ""); in main()
70 std::reference_wrapper<float (int)> >::value), ""); in main()
72 std::reference_wrapper<float (int, int)> >::value), ""); in main()
74 std::reference_wrapper<float(*)(int)> >::value), ""); in main()
76 std::reference_wrapper<float(*)(int, int)> >::value), ""); in main()
[all …]
/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.comparissons/
H A Dcompare.three_way.refwrap.refwrap_const.pass.cpp31 static_assert(std::three_way_comparable_with<std::reference_wrapper<StrongOrder>, const StrongOrder…
32 static_assert(std::three_way_comparable_with<std::reference_wrapper<WeakOrder>, const WeakOrder>);
33 static_assert(std::three_way_comparable_with<std::reference_wrapper<PartialOrder>, const PartialOrd…
35 static_assert(!std::three_way_comparable_with<std::reference_wrapper<StrongOrder>, const NonCompara…
36 static_assert(!std::three_way_comparable_with<std::reference_wrapper<WeakOrder>, const NonComparabl…
37 static_assert(!std::three_way_comparable_with<std::reference_wrapper<PartialOrder>, const NonCompar…
52 std::reference_wrapper<T> rw1{t}; in test()
53 std::reference_wrapper<const T> rw2{t}; in test()
58 std::reference_wrapper<T> rw1{smaller}; in test()
59 std::reference_wrapper<const T> rw2{bigger}; in test()
[all …]
H A Dcompare.three_way.refwrap.refwrap.pass.cpp31 static_assert(std::three_way_comparable<std::reference_wrapper<StrongOrder>>);
32 static_assert(std::three_way_comparable<std::reference_wrapper<WeakOrder>>);
33 static_assert(std::three_way_comparable<std::reference_wrapper<PartialOrder>>);
35 static_assert(!std::three_way_comparable<std::reference_wrapper<NonComparable>>);
50 std::reference_wrapper<T> rw1{t}; in test()
51 std::reference_wrapper<T> rw2{t}; in test()
56 std::reference_wrapper<T> rw1{smaller}; in test()
57 std::reference_wrapper<T> rw2{bigger}; in test()
62 std::reference_wrapper<T> rw1{bigger}; in test()
63 std::reference_wrapper<T> rw2{smaller}; in test()
[all …]
H A Dequal.refwrap.refwrap_const.pass.cpp31 static_assert(std::equality_comparable_with<std::reference_wrapper<EqualityComparable>,
32 std::reference_wrapper<const EqualityComparable>>);
34 static_assert(!std::equality_comparable_with<std::reference_wrapper<EqualityComparable>,
35 std::reference_wrapper<const NonComparable>>);
44 std::reference_wrapper<T> rw1{i}; in test()
46 std::reference_wrapper<T> rw3{j}; in test()
47 std::reference_wrapper<const T> crw1{i}; in test()
48 std::reference_wrapper<const T> crw3{j}; in test()
H A Dcompare.three_way.refwrap.const_ref.pass.cpp31 static_assert(HasSpaceshipOperatorWithInt<std::reference_wrapper<StrongOrder>>);
32 static_assert(HasSpaceshipOperatorWithInt<std::reference_wrapper<WeakOrder>>);
33 static_assert(HasSpaceshipOperatorWithInt<std::reference_wrapper<PartialOrder>>);
35 static_assert(!HasSpaceshipOperatorWithInt<std::reference_wrapper<NonComparable>>);
50 std::reference_wrapper<T> rw1{t}; in test()
55 std::reference_wrapper<T> rw1{smaller}; in test()
60 std::reference_wrapper<T> rw1{bigger}; in test()
65 std::reference_wrapper<T> rw1{bigger}; in test()
H A Dequal.refwrap.refwrap.pass.cpp30 static_assert(std::equality_comparable<std::reference_wrapper<EqualityComparable>>);
32 static_assert(!std::equality_comparable<std::reference_wrapper<NonComparable>>);
41 std::reference_wrapper<T> rw1{i}; in test()
42 std::reference_wrapper<T> rw2 = rw1; in test()
43 std::reference_wrapper<T> rw3{j}; in test()
44 std::reference_wrapper<const T> crw1{i}; in test()
45 std::reference_wrapper<const T> crw3{j}; in test()
/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/
H A Dweak_result.pass.cpp79 static_assert((std::is_same<std::reference_wrapper<functor1>::result_type, in main()
81 static_assert((std::is_same<std::reference_wrapper<functor2>::result_type, in main()
83 static_assert((std::is_same<std::reference_wrapper<functor3>::result_type, in main()
85 static_assert((std::is_same<std::reference_wrapper<void()>::result_type, in main()
87 static_assert((std::is_same<std::reference_wrapper<int*(double*)>::result_type, in main()
89 static_assert((std::is_same<std::reference_wrapper<void(*)()>::result_type, in main()
91 static_assert((std::is_same<std::reference_wrapper<int*(*)(double*)>::result_type, in main()
93 static_assert((std::is_same<std::reference_wrapper<int*(C::*)(double*)>::result_type, in main()
95 …static_assert((std::is_same<std::reference_wrapper<int (C::*)(double*) const volatile>::result_typ… in main()
97 static_assert((std::is_same<std::reference_wrapper<C()>::result_type, in main()
[all …]
H A Dunwrap_ref_decay.pass.cpp47 check<std::reference_wrapper<T>, T&>(); in main()
48 check<std::reference_wrapper<T>&, T&>(); in main()
49 check<std::reference_wrapper<T const>, T const&>(); in main()
50 check<std::reference_wrapper<T const>&, T const&>(); in main()
51 check<std::reference_wrapper<T*>, T*&>(); in main()
52 check<std::reference_wrapper<T*>&, T*&>(); in main()
53 check<std::reference_wrapper<T const*>, T const*&>(); in main()
54 check<std::reference_wrapper<T const*>&, T const*&>(); in main()
55 check<std::reference_wrapper<T[3]>, T (&)[3]>(); in main()
56 check<std::reference_wrapper<T[3]>&, T (&)[3]>(); in main()
[all …]
H A Dtype.pass.cpp24 static_assert((std::is_same<std::reference_wrapper<C>::type, in main()
26 static_assert((std::is_same<std::reference_wrapper<void ()>::type, in main()
28 static_assert((std::is_same<std::reference_wrapper<int* (double*)>::type, in main()
30 static_assert((std::is_same<std::reference_wrapper<void(*)()>::type, in main()
32 static_assert((std::is_same<std::reference_wrapper<int*(*)(double*)>::type, in main()
34 static_assert((std::is_same<std::reference_wrapper<int*(C::*)(double*)>::type, in main()
36 static_assert((std::is_same<std::reference_wrapper<int (C::*)(double*) const volatile>::type, in main()
H A Dbinder_typedefs.compile.pass.cpp35 static_assert(std::is_same<std::reference_wrapper<int(UnaryFunction::*)()>::result_type, int>::valu…
36 static_assert(std::is_same<std::reference_wrapper<int(UnaryFunction::*)()>::argument_type, UnaryFun…
38 static_assert(std::is_same<std::reference_wrapper<int(BinaryFunction::*)(char)>::result_type, int>:…
39 static_assert(std::is_same<std::reference_wrapper<int(BinaryFunction::*)(char)>::first_argument_typ…
40 static_assert(std::is_same<std::reference_wrapper<int(BinaryFunction::*)(char)>::second_argument_ty…
42 static_assert(std::is_same<std::reference_wrapper<void(*)()>::result_type, void>::value, "");
/llvm-project/flang/include/flang/Common/
H A Dreference-wrapper.h46 template <class _Tp> class reference_wrapper {
60 std::enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value,
62 constexpr RT_API_ATTRS reference_wrapper(_Up &&__u) { in reference_wrapper() function
79 template <class _Tp> reference_wrapper(_Tp &) -> reference_wrapper<_Tp>;
82 inline constexpr RT_API_ATTRS reference_wrapper<_Tp> ref(_Tp &__t) { in ref()
83 return reference_wrapper<_Tp>(__t); in ref()
87 inline constexpr RT_API_ATTRS reference_wrapper<_Tp> ref( in ref()
88 reference_wrapper<_Tp> __t) { in ref()
93 inline constexpr RT_API_ATTRS reference_wrapper<const _Tp> cref( in cref()
95 return reference_wrapper<const _Tp>(__t); in cref()
[all …]
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dreserved-identifier-invert.cpp27 class reference_wrapper { class
35 reference_wrapper(type &__f) in reference_wrapper() function in std::reference_wrapper
43 inline reference_wrapper<_Tp>
45 return reference_wrapper<_Tp>(__t); in ref()
49 inline reference_wrapper<_Tp>
50 ref(reference_wrapper<_Tp> __t) noexcept { in ref()
57 inline reference_wrapper<const Up>
61 return reference_wrapper<const Up>(u); in cref()
65 inline reference_wrapper<_Tp>
66 cref(reference_wrapper<const _Tp> __t) noexcept { in cref()
/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.invoke/
H A Dinvoke.pass.cpp55 std::reference_wrapper<void (int)> r1(f_void_1); in test_void_1()
65 std::reference_wrapper<void (*)(int)> r1(fp); in test_void_1()
75 std::reference_wrapper<A_void_1> r1(a0); in test_void_1()
85 std::reference_wrapper<void (A_void_1::*)()> r1(fp); in test_void_1()
100 std::reference_wrapper<void (A_void_1::*)() const> r1(fp); in test_void_1()
139 std::reference_wrapper<int (int)> r1(f_int_1); in test_int_1()
147 std::reference_wrapper<int (*)(int)> r1(fp); in test_int_1()
155 std::reference_wrapper<A_int_1> r1(a0); in test_int_1()
163 std::reference_wrapper<int (A_int_1::*)()> r1(fp); in test_int_1()
174 std::reference_wrapper<int (A_int_1::*)() const> r1(fp); in test_int_1()
[all …]
/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/
H A Dtype_conv_ctor.pass.cpp37 void meow(std::reference_wrapper<int>) {} in meow()
40 std::reference_wrapper<int> purr();
45 std::reference_wrapper<convertible_to_int_ref> r(t); in main()
50 std::reference_wrapper<const convertible_to_int_ref> r(t); in main()
54 using Ref = std::reference_wrapper<int>; in main()
63 std::reference_wrapper ri(i); in main()
64 static_assert((std::is_same<decltype(ri), std::reference_wrapper<int>>::value), ""); in main()
68 std::reference_wrapper rj(j); in main()
69 static_assert((std::is_same<decltype(rj), std::reference_wrapper<const int>>::value), ""); in main()
H A Ddeduct.pass.cpp20 std::reference_wrapper ri(i); in main()
21 static_assert(std::is_same_v<decltype(ri), std::reference_wrapper<int>>); in main()
22 std::reference_wrapper ri2(ri); in main()
23 static_assert(std::is_same_v<decltype(ri2), std::reference_wrapper<int>>); in main()
25 std::reference_wrapper rj(j); in main()
26 static_assert(std::is_same_v<decltype(rj), std::reference_wrapper<const int>>); in main()
27 std::reference_wrapper rj2(rj); in main()
28 static_assert(std::is_same_v<decltype(rj2), std::reference_wrapper<const int>>); in main()
/llvm-project/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/
H A Dresult_of.pass.cpp151 test_result_of<PMS0( std::reference_wrapper<S>), int> (); in main()
152 test_result_of<PMS0(const std::reference_wrapper<S>&), int> (); in main()
153 test_result_of<PMS0( std::reference_wrapper<SD>), int> (); in main()
154 test_result_of<PMS0(const std::reference_wrapper<SD>&), int> (); in main()
163 test_no_result<PMS0(std::reference_wrapper<S const>)>(); in main()
164 test_no_result<PMS0(std::reference_wrapper<ND> )>(); in main()
173 test_result_of<PMS1(std::reference_wrapper<S>, int), int*> (); in main()
174 test_result_of<PMS1(const std::reference_wrapper<S>&, int), int*> (); in main()
175 test_result_of<PMS1(std::reference_wrapper<SD>, int), int*> (); in main()
176 test_result_of<PMS1(const std::reference_wrapper<SD>&, int), int*> (); in main()
[all …]
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/Inputs/reserved-identifier/system/
H A Dsystem-header.h6 class reference_wrapper {
14 reference_wrapper(type &__f) in reference_wrapper() function
22 inline reference_wrapper<_Tp>
24 return reference_wrapper<_Tp>(__t); in ref()
28 inline reference_wrapper<_Tp>
29 ref(reference_wrapper<_Tp> __t) noexcept { in ref()
/llvm-project/libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/
H A Dcopy_assign.pass.cpp34 std::reference_wrapper<T> r(t); in test()
36 std::reference_wrapper<T> r2(t2); in test()
47 std::reference_wrapper<void ()> r(f); in test_function()
48 std::reference_wrapper<void ()> r2(g); in test_function()
72 using Ref = std::reference_wrapper<int>; in main()
/llvm-project/flang/runtime/
H A Dio-stmt.h224 std::variant<Fortran::common::reference_wrapper<OpenStatementState>,
225 Fortran::common::reference_wrapper<CloseStatementState>,
226 Fortran::common::reference_wrapper<NoopStatementState>,
227 Fortran::common::reference_wrapper<
229 Fortran::common::reference_wrapper<
231 Fortran::common::reference_wrapper<
233 Fortran::common::reference_wrapper<
235 Fortran::common::reference_wrapper<
237 Fortran::common::reference_wrapper<
239 Fortran::common::reference_wrapper<
[all...]
/llvm-project/clang/test/Sema/
H A Dwarn-lifetime-analysis-nocfg.cpp301 std::reference_wrapper<int> danglingPtrFromNonOwnerLocal() { in testLoops()
306 std::reference_wrapper<int> danglingPtrFromNonOwnerLocal2() { in usedToBeFalsePositive()
311 std::reference_wrapper<int> danglingPtrFromNonOwnerLocal3() {
313 return std::reference_wrapper<int>(i); // TODO in doNotFollowReferencesForLocalOwner()
316 std::reference_wrapper<Unannotated> danglingPtrFromNonOwnerLocal4() { in doNotFollowReferencesForLocalOwner()
318 return std::reference_wrapper<Unannotated>(i); // TODO
321 std::reference_wrapper<Unannotated> danglingPtrFromNonOwnerLocal5() { in trackThroughMultiplePointer()
220 struct reference_wrapper { global() struct

123456