Home » Community » U++ community news and announcements » EditField::operator String() removed
EditField::operator String() removed [message #46616] |
Mon, 13 June 2016 09:11  |
 |
mirek
Messages: 14256 Registered: November 2005
|
Ultimate Member |
|
|
This is a very unfortunate change, because it breaks existing code, OTOH is very easy to fix...
The problem is:
EditField f;
f << [&] { ... };
This supposed to assign lambda to EditField. However, with implicit cast to String, an alternative overload is
template <class T>
operator<<(String&&, const T&)
because of EditField::operator String().
Well, direct type assignment and retrieval from/to widgets was deprecated for some time, so in the end I decided that it is more important for us to be able to write e.g.
and always use operator ~ when retrieving value of widget.
So, if after updating to U++ trunk you see error like this:
c:\u\aws\openwind\OpenWind.h(1722): error C2664: 'Upp::FileSel &Upp::FileSel::ActiveDir(const Upp::String &)': cannot convert argument 1 from 'Upp::EditString' to 'const Upp::String &'
c:\u\aws\openwind\OpenWind.h(1722): note: Reason: cannot convert from 'Upp::EditString' to 'const Upp::String'
c:\u\aws\openwind\OpenWind.h(1722): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
please just add '~' before the widget....
Mirek
[Updated on: Mon, 13 June 2016 09:19] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri May 02 13:54:32 CEST 2025
Total time taken to generate the page: 0.00968 seconds
|