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 » Value class suggestion [FEATURE REQUEST]
Value class suggestion [FEATURE REQUEST] [message #2374] Mon, 10 April 2006 10:03 Go to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Hi!

Very often I have to use awful casting to be able to do:

Value v(1);

if((int)v == 1)
{
...
}

Could operator==(String &) and operator==(int) (two common cases) be added to Value class?

This code seems to be much more 'eye-candy'..
if(v == 1)

PS: Of course operator!= should be extended too..

[Updated on: Mon, 01 May 2006 15:09] by Moderator

Report message to a moderator

Re: Value class suggestion [message #2378 is a reply to message #2374] Mon, 10 April 2006 10:51 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Mon, 10 April 2006 04:03

Hi!

Very often I have to use awful casting to be able to do:

Value v(1);

if((int)v == 1)
{
...
}

Could operator==(String &) and operator==(int) (two common cases) be added to Value class?

This code seems to be much more 'eye-candy'..
if(v == 1)

PS: Of course operator!= should be extended too..


Hm, maybe we should try to resolve the ambiguity first? (It is quite a lot of operators to add Wink

Mirek
Previous Topic: What is lock for in MenuBar etc. classes? -[SOLVED]-recursive call
Next Topic: Moveable classes with virtual functions/Documentation error
Goto Forum:
  


Current Time: Wed May 08 10:44:05 CEST 2024

Total time taken to generate the page: 0.01877 seconds