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 » Strange issue with VectorMap<String, String>
Re: Strange issue with VectorMap<String, String> [message #26237 is a reply to message #26200] Fri, 16 April 2010 11:57 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14258
Registered: November 2005
Ultimate Member
Sc0rch wrote on Mon, 12 April 2010 07:58

Well, when I've removed this funcs:
XMLConfig& Set(const String& param, bool value);
XMLConfig& Set(const String& param, int value);

all is working now.

Why Set-func cann't be overloaded?

Best regards and sorry for my English,
Anton


They can. The problem is here:

XMLConfig& XMLConfig::Set(const String& param, bool value)
{
	return Set(param, value ? "true" : "false");
}


Preferred conversion of const char * is to bool - it is straight, while -> String it requires constructor pass. So you have infinite recursion here.

Fix: Add

XMLConfig& XMLConfig::Set(const String& param, const char *value)
{
	Map.GetAdd(param) = value;
	return *this;
}

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to program real U++ applications
Next Topic: WHY? "Index:: and ArrayIndex::operator[]" returns const T&
Goto Forum:
  


Current Time: Wed May 14 22:44:50 CEST 2025

Total time taken to generate the page: 0.03859 seconds