@@ -42,23 +42,15 @@ class weak_object : public detail::weak_object_base<SYCLObjT> {
42
42
constexpr weak_object () noexcept : detail::weak_object_base<SYCLObjT>() {}
43
43
weak_object (const SYCLObjT &SYCLObj) noexcept
44
44
: detail::weak_object_base<SYCLObjT>(SYCLObj) {}
45
- weak_object (const weak_object &Other) noexcept
46
- : detail::weak_object_base<SYCLObjT>(Other) {}
47
- weak_object (weak_object &&Other) noexcept
48
- : detail::weak_object_base<SYCLObjT>(Other) {}
45
+ weak_object (const weak_object &Other) noexcept = default ;
46
+ weak_object (weak_object &&Other) noexcept = default ;
49
47
50
48
weak_object &operator =(const SYCLObjT &SYCLObj) noexcept {
51
49
this ->MObjWeakPtr = sycl::detail::getSyclObjImpl (SYCLObj);
52
50
return *this ;
53
51
}
54
- weak_object &operator =(const weak_object &Other) noexcept {
55
- this ->MObjWeakPtr = Other.MObjWeakPtr ;
56
- return *this ;
57
- }
58
- weak_object &operator =(weak_object &&Other) noexcept {
59
- this ->MObjWeakPtr = std::move (Other.MObjWeakPtr );
60
- return *this ;
61
- }
52
+ weak_object &operator =(const weak_object &Other) noexcept = default ;
53
+ weak_object &operator =(weak_object &&Other) noexcept = default ;
62
54
63
55
std::optional<SYCLObjT> try_lock () const noexcept {
64
56
auto MObjImplPtr = this ->MObjWeakPtr .lock ();
@@ -95,15 +87,8 @@ class weak_object<buffer<T, Dimensions, AllocatorT>>
95
87
: detail::weak_object_base<buffer_type>(SYCLObj), MRange{SYCLObj.Range },
96
88
MOffsetInBytes{SYCLObj.OffsetInBytes },
97
89
MIsSubBuffer{SYCLObj.IsSubBuffer } {}
98
- weak_object (const weak_object &Other) noexcept
99
- : detail::weak_object_base<buffer_type>(Other), MRange{Other.MRange },
100
- MOffsetInBytes{Other.MOffsetInBytes }, MIsSubBuffer{Other.MIsSubBuffer } {
101
- }
102
- weak_object (weak_object &&Other) noexcept
103
- : detail::weak_object_base<buffer_type>(Other),
104
- MRange{std::move (Other.MRange )},
105
- MOffsetInBytes{std::move (Other.MOffsetInBytes )},
106
- MIsSubBuffer{std::move (Other.MIsSubBuffer )} {}
90
+ weak_object (const weak_object &Other) noexcept = default ;
91
+ weak_object (weak_object &&Other) noexcept = default ;
107
92
108
93
weak_object &operator =(const buffer_type &SYCLObj) noexcept {
109
94
this ->MObjWeakPtr = sycl::detail::getSyclObjImpl (SYCLObj);
@@ -112,20 +97,8 @@ class weak_object<buffer<T, Dimensions, AllocatorT>>
112
97
this ->MIsSubBuffer = SYCLObj.IsSubBuffer ;
113
98
return *this ;
114
99
}
115
- weak_object &operator =(const weak_object &Other) noexcept {
116
- this ->MObjWeakPtr = Other.MObjWeakPtr ;
117
- this ->MRange = Other.MRange ;
118
- this ->MOffsetInBytes = Other.MOffsetInBytes ;
119
- this ->MIsSubBuffer = Other.MIsSubBuffer ;
120
- return *this ;
121
- }
122
- weak_object &operator =(weak_object &&Other) noexcept {
123
- this ->MObjWeakPtr = std::move (Other.MObjWeakPtr );
124
- this ->MRange = std::move (Other.MRange );
125
- this ->MOffsetInBytes = std::move (Other.MOffsetInBytes );
126
- this ->MIsSubBuffer = std::move (Other.MIsSubBuffer );
127
- return *this ;
128
- }
100
+ weak_object &operator =(const weak_object &Other) noexcept = default ;
101
+ weak_object &operator =(weak_object &&Other) noexcept = default ;
129
102
130
103
std::optional<buffer_type> try_lock () const noexcept {
131
104
auto MObjImplPtr = this ->MObjWeakPtr .lock ();
0 commit comments