"Beman Dawes" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > [...] > In other words, there are four interface combinations: > > When T is not an array && conversion to T* is not desired: > > T& operator*() const; > T* operator->() const;
When T is an array, is it really necessary to disable these? I can see disabling operator->, but shouldn't operator* just return a reference to the first element? > [...] > When T is an array && conversion to T* is not desired: > > T& operator[](size_t i) const; > > When T is an array && conversion to T* is desired: > > operator T*() const; Trying a quick test case with both on Comeau shows that it is not ambiguous, and a quick test with BCB shows the right operator getting called. I guess I'm not sure why operator[] can't always be defined for array types. Dave _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost