help-gplusplus
[Top][All Lists]
Advanced

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

Re: How to use a constructor of hashsets?


From: Bernd Strieder
Subject: Re: How to use a constructor of hashsets?
Date: Thu, 12 Jul 2007 16:45:15 +0200
User-agent: KNode/0.10.4

Hello,

 benjamin.bihler@gmx.de wrote:

> #include <ext/hash_set>
> 
> 
> template<class PointerTemplate> class CTWTHashSet
> {
> 
> public:
> 
> CTWTHashSet(void);
> ~CTWTHashSet(void);
> 
> private:
> 
> class pointerEqualityFunction
> {

> };
> 
> class pointerHashFunction
> {

> };
> 
> __gnu_cxx::hash_set< PointerTemplate, pointerHashFunction,
> pointerEqualityFunction >
> m_hsPointerSet( 10 );
> };

Seriously, you should read in a C++ text book howto initialize class
members. Move the ( 10 ); from here to the initializer list in the
c'tor below. Did you do a lot of Java, before? It is quite different in
those aspects.

> 
> template<class PointerTemplate>
> CTWTHashSet<PointerTemplate>::CTWTHashSet()

: m_hsPointerSet( 10 )

> {
> }


Bernd Strieder



reply via email to

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