-
assigned issue to
- changed component to Compliance
- marked as bug
- changed version to 2019.3.2 release
dist_object<T>.fetch isn't a constant function
Issue #224
resolved
Shouldn’t the fetch function be a constant function given that it is only reading?
int get(dist_object<int> v, int rank) const {
return v.fetch(rank).wait();
}
doesn’t actually work as fetch isn’t constant.
Comments (4)
-
-
Proposed fix in pull request #90, which can also be used to patch your copy of UPC++.
-
- changed status to resolved
Fix issue 224: missing const qualifier on dist_object<T>.fetch()
→ <<cset ea7b3efeabe0>>
-
Merge pull request #90 into develop
- fetch-const: issue 224: Add test and update ChangeLog Fix issue 224: missing const qualifier on dist_object<T>.fetch()
→ <<cset 2ef844170b93>>
- Log in to comment
Thanks for the report - you've correctly identified a bug. This function is specified as const, but the implementation is non-conforming.
Note your example program is ill-formed for two reasons - the const qualifier cannot appear on a free function, and dist_object is not CopyConstructible, so it cannot be passed to a function by value (only by reference or pointer).
Here is a complete reproducer: