help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template problem


From: Robert Bauck Hamar
Subject: Re: Template problem
Date: Tue, 03 Jul 2007 17:58:50 +0200
User-agent: KNode/0.10.5

 benjamin.bihler@gmx.de wrote:
> Hello,
> 
>>  benjamin.bih...@gmx.de wrote:
>> >     __gnu_cxx::hash_set< PointerTemplate*, pointerHashFunction,
>> > pointerEquality, std::allocator< PointerTemplate* > >::iterator
>> > hash_setIterator;
>>
>> You need typename in front of this, it is a dependent type.
> 
> It works now! Thank you very much!
> 
> But could you explain to me the difference between the declaration of
> the hash set and the declaration of its iterator?

The iterator is a member of the hash_set.

> It seems to me, that both are dependent times or none of them, since the
> declaration is so similar!

No. The compiler knows that hash_set is a class template, and thus
hash_set<...> must be a type. But it cannot possibly know which members it
contains, because that depends on the template parameters, and the exact
template parameters is not known.

-- 
rbh


reply via email to

[Prev in Thread] Current Thread [Next in Thread]