Beman Dawes <[EMAIL PROTECTED]> writes:
> Here is the problem:
>
> If T is not an array, the interface must supply:
>
> T& operator*() const;
> T* operator->() const;
>
> If T is an array && conversion to T* is not desired, the
> interface must supply:
>
> T& operator[](size_t i) const;
>
> If conversion to T* is desired, the interface must supply:
>
> operator T*() const;
>
> 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 not an array && conversion to T* is desired:
>
> T& operator*() const;
> T* operator->() const;
> operator T*() const;
>
> 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;
Why can't operator T*() and operator[](size_t) coexist?
--
David Abrahams
[EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost