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 » LineEdit, EditFields, DocEdit » operator<<= in tree control reference example
Re: operator<<= in tree control reference example [message #30498 is a reply to message #30497] Wed, 05 January 2011 11:07 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Well <<= is pretty standard for U++, and comes often in pair with ~, which does the opposite. For controls it is SetValue/GetValue. It is just one of the conventions you need to learn and what contributes to the learning curve of U++. It is the same with standard C++ and << for streams and other conventions.

The reason "=" is not used because it would be confusing. You use "=" between different types, but only if they are near identical/easily convertible. Like different representation of the same data. But an EditField is not a Value. It has a Value. This is why we use <<=, or the "kind of assign operator, but more of s take this value and use it" operator.

Until you are comfortable with this, you can avoid operator overloading in your code.

As for memory allocation failures, it is very hard to recover for them in a reliable way. It is easy if you have a malloc, but in real and complex applications with advance memory allocation it is hard. So U++ should print an error message and fail.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: recent MinMax Refresh fix not GCC compilable
Next Topic: New Select form in DocEdit or LineEdit
Goto Forum:
  


Current Time: Tue May 07 11:37:58 CEST 2024

Total time taken to generate the page: 0.02459 seconds