Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-01-14 11:44:43


> > Hmm, I guess in this particular case there's no harm in simply leaving
> > operator[] in there, even if you do provide a conversion to pointer. The
> > compiler will prefer it, which is a good thing because you have more
> > control.
>
> Sometimes having both operator[] and a conversion to a pointer creates
> ambiguities, depending on the type of the index.

You can provide operator[] for all integral types, or - simplest way - a
template.

Andrei

---------------------------------
Check out THE C++ Seminar: 3 Days with 5 Experts
http://www.gotw.ca/cpp_seminar/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk