Am I nuts?
Oct. 25th, 2006 03:56 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I'm rather offended, having been bitten by this bug. Why is it even allowed to take a reference to a const reference, if it could be a copy?!?
#include <assert.h> class Blah { public: const unsigned int &myfoo; Blah(const unsigned int &p): myfoo(p) {} const unsigned int getfoo() { return myfoo; } }; int main() { int foo(42); Blah baz(foo); ++foo; assert(foo == baz.getfoo()); return 0; }