const and immutable

Tim Verweij tjverweij at gmail.com
Tue Jul 6 09:04:00 PDT 2010


Thanks for all replies, that was very helpful. I have one more question about
inout. If I understand correctly, it is always coupled to the use of a parameter
and cannot be used to get rid of the double GetBar in the following C++ example:

class Foo
{
public:
  const Bar& GetBar() { return bar; } const
        Bar& GetBar() { return bar; }
private:
  Bar bar;
}

Is this correct? Thx for your replies.


More information about the Digitalmars-d-learn mailing list