Блог пользователя kphmd

Автор kphmd, 15 лет назад, По-английски
#define foreach(ite,sets) for(__typedef(sets.begin()) ite=sets.begin();ite!=sets.end();ite++)
Do you like this code?
gl & hf
  • Проголосовать: нравится
  • -17
  • Проголосовать: не нравится

15 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

(double post)
15 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится
15 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится
Do people enjoy living in the past? Why do you need a macro for something which has been part of the language for a while now?

int my_array[5] = {1, 2, 3, 4, 5};
for (int &x: my_array) {
    x *= 2;
}


15 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

If one feels necessity of such constructions, may be it is time to change to java?

Surely there are far more languages, I just suppose that java syntax would not be radically new to C++ programmer and performance decrease would not be radical too... Note that I am not against C++ (I use it for more than 10 years already), but sometimes I feel that there is too much plus-pluses for one poor programmer... ;-)