Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » C++11 library features finished
Re: C++11 library features finished [message #46588 is a reply to message #46585] Sat, 04 June 2016 05:36 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
There is a bug in AMap<K, T, V>::FindPut(const K& k, T&& init). It should look like below.
template <class K, class T, class V>
int AMap<K, T, V>::FindPut(const K& k, T&& init)
{
	unsigned hash = key.hashfn(k);
	int i = Find(k, hash);
	if(i < 0) {
		i = key.Put(k, hash);
		value.At(i) = pick(init);
	}
	return i;
}

The same problem can be found in other methods where you are using r-value directly (without "pick").
Below is a test case.
	VectorMap<int, Vector<int> > x;
	x.FindPut(1, Vector<int>());

You can just try to compile all methods taking r-value and see what happens.

EDIT: I've attached a patch.

Regards
  • Attachment: AMap.zip
    (Size: 5.72KB, Downloaded 264 times)


Regards,
Novo

[Updated on: Sat, 04 June 2016 15:47]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ide: Optimal mode removed
Next Topic: How You will celebrate 10 000 commit of U++?
Goto Forum:
  


Current Time: Wed May 07 10:21:46 CEST 2025

Total time taken to generate the page: 0.04332 seconds