Skip to content

Mark comparison operators in ck-core const #3848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ck-core/charm++.h
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ class CProxy_Group : public CProxy {
/* CProxy_Group(const NodeGroup *g) //<- for compatability with NodeGroups
:CProxy(), _ck_gid(g->ckGetGroupID()) {}*/

bool operator==(const CProxy_Group& other) {
bool operator==(const CProxy_Group& other) const {
return ckGetGroupID() == other.ckGetGroupID();
}

Expand Down Expand Up @@ -918,7 +918,7 @@ class CProxyElement_Group : public CProxy_Group {
/*CProxyElement_Group(const NodeGroup *g) //<- for compatability with NodeGroups
:CProxy_Group(g), _onPE(CkMyPe()) {}*/

bool operator==(const CProxyElement_Group& other) {
bool operator==(const CProxyElement_Group& other) const {
return ckGetGroupID() == other.ckGetGroupID() &&
ckGetGroupPe() == other.ckGetGroupPe();
}
Expand Down Expand Up @@ -1024,7 +1024,7 @@ class CProxy_NodeGroup : public CProxy{
/* CProxy_Group(const NodeGroup *g) //<- for compatability with NodeGroups
:CProxy(), _ck_gid(g->ckGetGroupID()) {}*/

bool operator==(const CProxy_NodeGroup& other) {
bool operator==(const CProxy_NodeGroup& other) const {
return ckGetGroupID() == other.ckGetGroupID();
}

Expand Down
4 changes: 2 additions & 2 deletions src/ck-core/ckarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class CProxy_ArrayBase : public CProxy
CProxy_ArrayBase(const ArrayElement* e);
CProxy_ArrayBase(const CProxy_ArrayBase& cs) : CProxy(cs), _aid(cs.ckGetArrayID()) {}

bool operator==(const CProxy_ArrayBase& other)
bool operator==(const CProxy_ArrayBase& other) const
{
return ckGetArrayID() == other.ckGetArrayID();
}
Expand Down Expand Up @@ -176,7 +176,7 @@ class CProxyElement_ArrayBase : public CProxy_ArrayBase
return *this;
}

bool operator==(const CProxyElement_ArrayBase& other)
bool operator==(const CProxyElement_ArrayBase& other) const
{
return ckGetArrayID() == other.ckGetArrayID() && ckGetIndex() == other.ckGetIndex();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/ckarrayindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct CkArrayIndexBase
p((char *)this, sizeof(CkArrayIndexBase));
}

bool operator==(CkArrayIndexBase &other) {
bool operator==(const CkArrayIndexBase &other) const {
if(nInts != other.nInts) return false;
if(dimension != other.dimension) return false;
for (int i=0;i<nInts;i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/ckcallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class CkCallback {
bool isExtCallback = false;
#endif

bool operator==(CkCallback & other){
bool operator==(const CkCallback & other) const {
if(type != other.type)
return false;
switch (type) {
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/cksection.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CkSectionInfo {
CkSectionInfo(int e, void *p, int r, CkArrayID _aid)
: val(p), aid(_aid), pe(e), redNo(r) { }

bool operator==(CkSectionInfo &other) const {
bool operator==(const CkSectionInfo &other) const {
return (val == other.val && aid == other.aid && pe == other.pe && redNo == other.redNo);
}

Expand Down
Loading