HashMap bug

Please post support and help requests here.
Posts: 8
Joined: 26 Dec 2006, 04:33
Location: United_States

HashMap bug

Postby eran » 12 May 2007, 05:56

This does not compile:

typedef Poco::HashMap PMap;
typedef std::map SMap;

PMap pmap;
SMap smap;

PMap::ConstIterator pmapIter = pmap.find(1);
pmapIter = pmap.find(2);

SMap::const_iterator smapIter = smap.find(1);
smapIter = smap.find(2);

For some reason the poco map does not behave like the std map.


Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: HashMap bug

Postby guenter » 14 May 2007, 08:42

I have filed a bug report on Sourceforge. Will look at it later.

Posts: 5
Joined: 16 Feb 2007, 05:54
Location: United_States

Re: HashMap bug

Postby lewislp » 17 May 2007, 01:40

I think the problem is that Iterator and ConstIterator map to fundamentally different types that are not easily convertible due to differing template parameters to BasicIterator. The easiest solution may be to provide two copy and assignment methods for Basiciterator explicitly allowing each one. For example:

^BasicIterator(const BasicIterator<typename BucketVec: :iterator, typename Bucket::iterator>& it);

BasicIterator(const BasicIterator<typename BucketVec: :const_iterator, typename Bucket::const_iterator>& it);^

I think the STL extension hash_map solves this problem but not using other STL containers for the bucket list and bucket contents.

Is there a way to drop in code blocks where < and : : doesn't drive the markup engine crazy?

Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests