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 » Community » Coffee corner » Quiz #2
Quiz #2 [message #57780] Mon, 13 December 2021 15:55 Go to next message
mirek is currently offline  mirek
Messages: 14162
Registered: November 2005
Ultimate Member
What is the difference between

VectorMap<int, String> vm;
...
for(const auto& m : vm) ...


and

VectorMap<int, String> vm;
...
for(const auto& m : ~vm) ...

Re: Quiz #2 [message #57781 is a reply to message #57780] Mon, 13 December 2021 17:18 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1143
Registered: August 2007
Senior Contributor
1. Enumarates the values in the vm.
2. Enumaretes the key-value pairs in the vm (as KeyValueRef struct - a very handy feature!)?

Smile

Best regards,
Oblivion


Re: Quiz #2 [message #57782 is a reply to message #57781] Mon, 13 December 2021 17:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14162
Registered: November 2005
Ultimate Member
Oblivion wrote on Mon, 13 December 2021 17:18
1. Enumarates the values in the vm.
2. Enumaretes the key-value pairs in the vm (as KeyValueRef struct - a very handy feature!)?

Smile

Best regards,
Oblivion


Correct. There is also a slight difference with handling Unlinked items - first variant includes them, second one skips them.
Re: Quiz #2 [message #57859 is a reply to message #57781] Wed, 22 December 2021 09:44 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
The number 2 is clever ! I can't count how many time I did this:

for(const auto& m : vm.GetKeys())
...
Previous Topic: Quiz #3
Next Topic: Some Experiment with Size of Upp Executable
Goto Forum:
  


Current Time: Sat Dec 14 14:23:37 CET 2024

Total time taken to generate the page: 0.03140 seconds