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   |
 |
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;
}
|
|
|
Goto Forum:
Current Time: Wed May 14 22:44:50 CEST 2025
Total time taken to generate the page: 0.03859 seconds
|