Alfredo Braunstein wrote:

> What's the point on having
> 
> class duh {
> public:
>         int & foo() { return foo_; }
> private:
>         int foo_;
> }
> 
> What's the advantage wrt. have a public foo? (I can only see
> disadvantages)

(Possible) practical advantage:

int & duh::foo() 
{ 
#ifdef DEBUG
        std::cerr << "foo\n";
#endif
        return foo_;
}

I think that really it is a matter of religion.

-- 
Angus

Reply via email to