Home » U++ Library support » U++ Core » VectorMap iteration
Re: VectorMap iteration [message #61774 is a reply to message #61773] |
Fri, 08 August 2025 12:17   |
Oblivion
Messages: 1223 Registered: August 2007
|
Senior Contributor |
|
|
Hi Massimo,
It does work. You need to use tilde (~) operator, which returns KeyValueRef:
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT);
VectorMap<int, String> m = { {1, "one"}, {2, "two"}};
for(const auto& [i, s] : ~m)
LOG("i: " << i << ", s: " << s);
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 08 August 2025 12:19] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Aug 12 06:18:29 CEST 2025
Total time taken to generate the page: 0.07156 seconds
|