0

I have the following: first a string that is not a constant

std::string anId;

an object that is a constant

const Object * object;

This object has a method like

 const std::shared_ptr<RawData> GetRawData(const std::string &);

and there is a function like this

getData(const std::shared_ptr<RawData> raw_ptr);

So, when I do this:

getData(object->GetRawData(anId));

I get the error

error: passing ‘const Object ’ as ‘this’ argument discards qualifiers [-fpermissive]
         int stat = getData(object->GetRawData(anId));

Except the first string, I don't see how I am not passing constants... I wonder where is the error coming from

KansaiRobot
  • 5,148
  • 7
  • 44
  • 95

0 Answers0