Skip to content

Commit 9ddb3ed

Browse files
jszadayevan-charmworks
authored andcommitted
Add Copy Constructor to CProxyElement_ArrayBase (#3437)
* Add Copy Constructor to CProxyElement_ArrayBase * Add Copy-Assign to Satisfy 'Rule of Two'
1 parent e3ea5c1 commit 9ddb3ed

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ck-core/ckarray.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,17 @@ class CProxyElement_ArrayBase : public CProxy_ArrayBase
169169
: CProxy_ArrayBase(aid), _idx(idx)
170170
{
171171
}
172+
CProxyElement_ArrayBase(const CProxyElement_ArrayBase& other)
173+
: CProxy_ArrayBase(other.ckGetArrayID()), _idx(other.ckGetIndex())
174+
{
175+
}
172176
CProxyElement_ArrayBase(const ArrayElement* e);
173177

178+
CProxyElement_ArrayBase& operator=(const CProxyElement_ArrayBase& other)
179+
{
180+
return *this = CProxyElement_ArrayBase(other);
181+
}
182+
174183
bool operator==(const CProxyElement_ArrayBase& other)
175184
{
176185
return ckGetArrayID() == other.ckGetArrayID() && ckGetIndex() == other.ckGetIndex();

0 commit comments

Comments
 (0)