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 » VectorMap.Get (Problem fetching value of vectormap second time)
VectorMap.Get [message #45231] Tue, 13 October 2015 14:31 Go to previous message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hi,

When I want to get the content of VecotorMap second time I am getting Assert Failed error.


#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	Vector<int> v1;
	VectorMap<String,Vector<int>> Vm ;
	
	v1.Clear();
	v1.Add(0);
	v1.Add(3);
	Vm.Add("key1",v1);

	v1.Clear();
	v1.Add(10);
	v1.Add(31);
	v1.Add(41);
	Vm.Add("key2",v1);
	
	Vector<int> v2 ;
	v2 = Vm.Get("key1");
	DUMP(v2);

	v2.Clear();
	v2 = Vm.Get("key2");
	DUMP(v2);
	
	v2.Clear();
	v2 = Vm.Get("key1");
	DUMP(v2);
}



Log content
v2 = [0, 3]
v2 = [10, 31, 41]
v2 = ****************** ASSERT FAILED: Assertion failed in c:\devtools\upp_git\uppsrc\core\Vcont.h, line 34
Broken rval_ semantics



It is working whith VectorMap<String,String>
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	VectorMap<String,String> v1;
	
	v1.Add("key1","val1");
	v1.Add("key2","val2");
	v1.Add("key3","val3");
	
	String s;
	
	s.Clear();
	s= v1.Get("key1");
	DUMP(s);
	
	s.Clear();
	s= v1.Get("key2");
	DUMP(s);
	
	s.Clear();
	s= v1.Get("key3");
	DUMP(s);
	
	s.Clear();
	s= v1.Get("key1");
	DUMP(s);
}


Log content
s = val1
s = val2
s = val3
s = val1


Warm Regards

Deepak

[Updated on: Tue, 13 October 2015 14:42]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Suggestion for StringBuffer
Next Topic: LocalProcess child process killing in WIndows
Goto Forum:
  


Current Time: Thu Apr 25 10:48:20 CEST 2024

Total time taken to generate the page: 0.05613 seconds