
25 Apr
2004
25 Apr
'04
9:31 a.m.
Eric Niebler wrote:
This is in reference to the following line of code: for (crange<int> const & r = mkrange(d); r; ++r)
Making the assignment operator private would do nothing since it is not being called here.
Right, my bad.
Making the copy constructor private wouldn't help either because the copy constructor must be accessible in order to bind a temporary to a const reference. (Not all compilers enforce this rule.)
The copy constructor is indeed called here, but if you forget the &, a conversion constructor will be called if it's present. That should be made private. -- Anatoli Tubman PTC Israel (Haifa) Tel. (+972) 4-8550035 ext. 229