Overview
Features
Download
Documentation
Community
Add-Ons & Services

HashMap bug

Please post support and help requests here.

HashMap bug

Postby eran » 12 May 2007, 05:56

This does not compile:

void
test()
{
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.

EHL
eran
 
Posts: 8
Joined: 26 Dec 2006, 04:33
Location: United_States

Re: HashMap bug

Postby guenter » 14 May 2007, 08:42

I have filed a bug report on Sourceforge. Will look at it later.
guenter
 
Posts: 1092
Joined: 11 Jul 2006, 16:27
Location: Austria

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?
lewislp
 
Posts: 5
Joined: 16 Feb 2007, 05:54
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest