Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: someclass::enumerate (Read 1195 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

someclass::enumerate

First of all, thanks for the shiny new SDK with the simplified string stuff.

Forgive me if I'm misunderstanding but I thought this entry in the changelog...

Quote
Added new syntax for enumerating foobar2000 services: for( auto ptr : someclass::enumerate() ) { ... }

meant I could refactor old code that looks like this...

Code: [Select]
for (auto e = service_enum_t<mainmenu_commands>(); !e.finished(); ++e)
{
auto ptr = *e;
ptr->do_something();
}

in to this...

Code: [Select]
for (auto ptr : mainmenu_commands::enumerate())
{
ptr->do_something();
}

but I get this error...

Code: [Select]
this range-based 'for' statement requires a suitable "begin" function and none was found