От: | Caracrist | https://1pwd.org/ | |
Дата: | 28.03.17 07:59 | ||
Оценка: | 11 (4) |
// Adds name to a scope/loop and allows to break from it by name
// Example:
// LABELED(outerLoop) for (auto it = container.begin(); it != container.end(); it++)
// {
// switch (*it)
// {
// case 1:
// BREAK_FROM(outerLoop);
// }
// }
#define LABELED(scopeName) if (false) scopeName:; else
#define BREAK_FROM(scopeName) goto scopeName