Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-12-01 20:18:42


At 04:36 PM 12/1/2002, Aleksey Gurtovoy wrote:

>Beman Dawes wrote:
>> Hum... I'll take your word for it, but to tell the truth I
>> have trouble understanding what either ``this->member_name''
>> or `BaseClass::member_name'' adds.
>
>It makes 'member_name' identifier a dependent name (14.6.2, [temp.dep]),
>thus deferring its resolution to the point of instantiation.

That was the point I was missing. Thanks to you and Dave for the
clarification. I'll read Dave's posting carefully in the morning when my
brain is more active.

>
>> And the format library case
>> wasn't a member name at all, it was an enum name, IIRC.
>
>Looking at the errors that triggered the discussion, they don't seem to
be
>related to two-phase name lookup at all:
>
> namespace boost {
> namespace io {
> enum format_error_bits { bad_format_string_bit = 1,
> too_few_args_bit = 2, too_many_args_bit = 4,
> out_of_range_bit = 8,
> all_error_bits = 255, no_error_bits=0 };
> } // namespace io
>
> // ...
>
> template< class Ch, class Tr>
> basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_bind(int argN)
> // cancel the binding of ONE argument, and clear()
> {
> // ....
> if( exceptions() & out_of_range_bit )
> ^^^^^^^^^^^^^^^^
> ....
>
> } // namespace boost
>
>'out_of_range_bit' is defined in the namespace 'io', and there is no way
it
>can be found through a plain 'out_of_range_bit' (not
>'io::out_of_range_bit'), two-phase name lookup or not :).

That was what I thought, too, yet other compilers seemed to be accepting
the code, so I assumed it was also two-phase lookup related. Perhaps the
other compilers weren't actual instantiating that code. Anyhow, Samuel has
added the io:: qualification and Metrowerks is now passing the tests, and I
and other readers have learned a bit more about two-phase lookup.

Thanks,

--Beman


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