J
Jim Langston
I'm a little confused. I have a class function declared like:
const CItem& operator << (const std::string &sIn);
Which I use like this:
CItem Item;
Item << "blaster01,1,0,...,0,0,20,0,0,20,eol";
At the end of the method it does:
return *this;
My question is, is my const on the return value doing anything? I don't
know why I even have it there (maybe I copied this method from some source).
const CItem& seems to be to define a reference to a CItem that is constant.
Is that correct? Item is not declared as const, however. Maybe with the
way I'm using this thing I don't need to return any value at all anyway?
const CItem& operator << (const std::string &sIn);
Which I use like this:
CItem Item;
Item << "blaster01,1,0,...,0,0,20,0,0,20,eol";
At the end of the method it does:
return *this;
My question is, is my const on the return value doing anything? I don't
know why I even have it there (maybe I copied this method from some source).
const CItem& seems to be to define a reference to a CItem that is constant.
Is that correct? Item is not declared as const, however. Maybe with the
way I'm using this thing I don't need to return any value at all anyway?