Boost logo

Boost :

From: Maxim Yegorushkin (e-maxim_at_[hidden])
Date: 2004-09-25 06:51:13


Reece Dunn <msclrhd_at_[hidden]> wrote:

> Sure. I am using a modified version of flex_string to implement
> fixed_string, so reviewing both (and also immutable strings) would be a
> good idea.

I have a comment regarding the code of basic_string_impl. In its member
functions it uses unqualified names of base class's functions. Like this:

       template< class Base, class ErrorPolicy = noerror_string_policy >
       class basic_string_impl: public Base
       {
             // ...
             inline const_iterator begin() const
             {
                return( begin_());
             }
             // ...
       }

On a conforming compiler this code won't compile, because the first phase
of name lookup never considers argument dependent base classes for
unqualified names (while the second phase doing ADL only). I don't have a
gcc 3.4, which does two-phase name lookup, to check, but I believe it
won't compile it.

I advise using qualified base class's function names by prefixing them
with this-> or, better, with this->Base:: because in this case you won't
have to mangle base class's function names with _ suffix.

-- 
Maxim Yegorushkin

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