Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-17 22:47:19


----- Original Message -----
From: "Greg Colvin" <gcolvin_at_[hidden]>

> I meant no conflicts with other uses of the same wart.
> If you use the same name for two different entities in
> the same scope you lose. So don't do that.

In my example below the names are not in the same scope:
int ::f();
char* ::B<int>::f();

> Various
> warts and naming conventions can help avoid the mistake,
> but none are perfect. In template code, as you said,
> this-> is the most reliable approach.
>
>
> > Maybe one:
> >
> > int f();
> >
> > template <class T>
> > struct B {
> > char* f();
> > };
> >
> > template <class T>
> > struct X : B<T> {
> > void g() {
> > char* p = f(); // not B<T>::f!
> > }
> > };
> > int main() {
> > X<int> x;
> > x.g();
> > }
> >
> >


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