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: why not float support?
Re: Value: why not float support? [message #30392 is a reply to message #30391] Mon, 27 December 2010 14:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
kohait00 wrote on Mon, 27 December 2010 08:28

i dont mind handling float as double in cpu context, in functions etc. but in my case, sending and receiving is done with distinct types, float and double, unfortunately not interchangeable, it's compareable to storing things Smile.

well, my problem is actually, that i wanted to use Value as a cool implicit convertable container for arbitrary values (which it is). to save me the hassle of converting them manually, since a lot is already present. but lacking float makes it difficult to use in my case ofcorse. i might need to specify own converters which support float as well beeing a RichValue<>.

use case is indeed: an OSC Method handler receives i.e a Value as parameter, which is to be sent as float: so, if it is double, its converted, if it is int, also, if it's a String, it's tried to be parsed. etc.. thus the interface is really versatile and forgiving.

so i can set up different controls, that 'generate' internally different types (editfield a String, Option a bool/int value) but are sent as float etc.. so i dont need to care about types inside the controls already. i simply specify which type the OSC message should finally be sent as.



Well, if I understood well what you have just wrote, I see it as argument NOT TO introduce 'float' into Value... Smile You can put float to Value now (as double). And you have to know the true signature of OSC method anyway, so that you can convert all parameters.

So introducing float would be no advantage here.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core/Path.cpp: the limitation of GetCurrentDirectory for POSIX
Next Topic: InitCaps() proposal
Goto Forum:
  


Current Time: Tue Jul 01 06:30:50 CEST 2025

Total time taken to generate the page: 0.03286 seconds