All pastes #568512 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-15 15:58 UTC
rendered paste body
class X {
    void foo() const { }
    void moo() { }
};

X a;
const X b;


a.foo(); // ok
a.moo(); // ok

b.foo(); // ok, becuz b (this) is const
b.moo(); // NOT OK, moo() expects a non-const "this", but b was declared const (const X b)