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 » Developing U++ » U++ Developers corner » Helper for internazionalize arrays of literals
Re: Helper for internazionalize arrays of literals [message #24331 is a reply to message #24330] Mon, 11 January 2010 11:12 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
mdelfede wrote on Mon, 11 January 2010 05:09

BTW, I had to change it like this :
struct StringTable {
	const char *s;

	String ToString() const       { return GetLngString(s); }
	operator const char *() const { return ToString(); }
	operator String() { return ToString(); }
	operator Value() { return ToString(); }
};


Otherwise it didn't work here :

DropList d;
int i = 0;
d.Add(i, myStringTable[i]);


Don't know exactly why he didn't pick automatically the char * --> Value conversion. Even adding the String() operator wasn't enough.

Ciao

Max



Well, I believe it is "one-conversion-operator" rule: C++ never goes through more than single conversion. tt_char -> const char * -> Value is two conversions. (And String does not change much there...).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GCC compilation options
Next Topic: Template class factory
Goto Forum:
  


Current Time: Sat May 11 17:47:19 CEST 2024

Total time taken to generate the page: 0.02940 seconds