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 » Question about SubRange.
Re: Question about SubRange. [message #49222 is a reply to message #49221] Mon, 08 January 2018 16:21 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 08 January 2018 15:55
mirek wrote on Mon, 08 January 2018 05:52

Not true (not in U++ nor STL). That is basically a reason for those 2 overloads. E.g. try Sort with just const variant...

The "C& c" variant is definitely not needed. The "C&& c" variant is an universal reference and it is a complete replacement of the "C& c" variant. I tried to compile TheIDE with "C& c" commented out and it compiles just fine.


theide is not a good representative, as there probably is not a single use of subrange.

It is quite possible that C& is not needed, but I think I had some issues with at least some compilers with that approach. But it would really be a great if I could remove them...

Quote:

And I'm still a little bit confused about what is IterSwap for. What is wrong with the regular Swap?


When sorting Array, you can swap just pointers instead of objects - it is optimization.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ReadSecret() function for reading passwords, etc. from the console.
Next Topic: I've been using FindFile wrong all these years
Goto Forum:
  


Current Time: Sat Apr 27 13:29:04 CEST 2024

Total time taken to generate the page: 0.03034 seconds