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   |
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
|
|
|
 |
|
C++11 library features finished
By: mirek on Mon, 31 August 2015 13:38
|
 |
|
Re: C++11 library features finished
|
 |
|
Re: C++11 library features finished
By: slashupp on Sun, 15 November 2015 17:16
|
 |
|
Re: C++11 library features finished
|
 |
|
Re: C++11 library features finished
By: Novo on Thu, 19 November 2015 04:41
|
 |
|
Re: C++11 library features finished
By: mirek on Thu, 19 November 2015 15:31
|
 |
|
Re: C++11 library features finished
By: Novo on Fri, 20 November 2015 02:50
|
 |
|
Re: C++11 library features finished
By: mirek on Thu, 19 November 2015 15:29
|
 |
|
Re: C++11 library features finished
|
 |
|
Re: C++11 library features finished
By: Alboni on Wed, 01 June 2016 03:22
|
 |
|
Re: C++11 library features finished
By: mirek on Wed, 01 June 2016 23:24
|
 |
|
Re: C++11 library features finished
By: Novo on Fri, 03 June 2016 19:27
|
 |
|
Re: C++11 library features finished
By: Novo on Fri, 03 June 2016 19:38
|
 |
|
Re: C++11 library features finished
By: Novo on Sat, 04 June 2016 05:36
|
 |
|
Re: C++11 library features finished
By: mirek on Thu, 09 June 2016 14:05
|
 |
|
Re: C++11 library features finished
By: Novo on Fri, 10 June 2016 05:09
|
 |
|
Re: C++11 library features finished
By: mirek on Sat, 11 June 2016 20:55
|
Goto Forum:
Current Time: Wed May 07 10:21:46 CEST 2025
Total time taken to generate the page: 0.04332 seconds
|