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++ TheIDE » U++ TheIDE: Layout (Forms) Designer » operator ambiguous
operator ambiguous [message #29793] Wed, 17 November 2010 12:32 Go to next message
o_wild is currently offline  o_wild
Messages: 28
Registered: December 2008
Location: Urmqi
Promising Member
The expression
~edit_D - ~edit_ddd
will cause an error:
ambiguous overload for 'operator-' in 'Upp::Ctrl::operator~() const() - Upp::Ctrl::operator~()
const()'
candidates are: operator-(double, double) <built-in>
operator-(double, int) <built-in>
operator-(double, Upp::int64) <built-in>
...
(edit_D is EditDouble and edit_ddd is EditInt.)
Even I replace the ~ to .GetData(), error remains.
Re: operator ambiguous [message #29794 is a reply to message #29793] Wed, 17 November 2010 13:40 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

The problem is that GetData() (and ~ as well, as it is just shorthand for the same) return Value, which can store one of many different types. If you store the value to variable (e.g. int i= ~editint) then it is casted automatically. But if you want to use value in some more complex statements, such as the one you encountered, you have to tell the compiler what type is in the Value explicitly. That can be done for example like this: (double)~edit_D - (double)~edit_ddd.

Best regards,
Honza
Previous Topic: Direct generate implement file from .lay file
Next Topic: How to isolate Layouter to layout for custom export files /drag,resize Ctrl's at runtime
Goto Forum:
  


Current Time: Sun Jun 23 16:28:43 CEST 2024

Total time taken to generate the page: 0.01754 seconds