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 » U++ Library support » U++ Core » stable sort bug.. or looks like it
Re: stable sort bug.. or looks like it [message #48136 is a reply to message #48135] Tue, 23 May 2017 14:19 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
aftershock wrote on Tue, 23 May 2017 11:18
I mean
before the operation stablesortbykey

we have key/value pair
(tester_withdraw_when) 0

after the operation

(tester_withdraw_when) 3

So the unity of key/pair is not kept... the key loses its value to something else.


That is really weird. I have just tested with this code:

#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	VectorMap<int, String> map;

	for(int i = 0; i < 100; i++) {
		int n = Random(200);
		map.Add(n, FormatIntRoman(n) + " " + AsString(n) + " " + AsString(i));
	}
	
	DUMPM(map);
	
	StableSortByKey(map);
	
	DUMPM(map);
}


and everything seems 100% fine.

Can you post your testcase please?

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing Bits object to disk
Next Topic: How to distribute some parts of Core in another library?
Goto Forum:
  


Current Time: Tue May 14 04:39:39 CEST 2024

Total time taken to generate the page: 0.01252 seconds