Skip to content
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

Maintain constness of accessed XmlRpcValue struct #2315

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions utilities/xmlrpcpp/include/xmlrpcpp/XmlRpcValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ namespace XmlRpc {
XmlRpcValue const& operator[](int i) const { assertArray(i+1); return _value.asArray->at(i); }
XmlRpcValue& operator[](int i) { assertArray(i+1); return _value.asArray->at(i); }

XmlRpcValue& operator[](std::string const& k) const { assertStruct(); return (*_value.asStruct)[k]; }
XmlRpcValue const& operator[](std::string const& k) const { assertStruct(); return _value.asStruct->at(k); }
XmlRpcValue& operator[](std::string const& k) { assertStruct(); return (*_value.asStruct)[k]; }
XmlRpcValue& operator[](const char* k) const { assertStruct(); std::string s(k); return (*_value.asStruct)[s]; }
XmlRpcValue const& operator[](const char* k) const { assertStruct(); std::string s(k); return _value.asStruct->at(s); }
XmlRpcValue& operator[](const char* k) { assertStruct(); std::string s(k); return (*_value.asStruct)[s]; }

iterator begin() {assertStruct(); return (*_value.asStruct).begin(); }
Expand Down