Extract it into a function and stick it into your library, it's extremely useful :)
Anyway, the proposed solutions use twice much memory than a simple for loop...is the compiler smart enougth to optimize this kind of code ?
Extract it into a function and stick it into your library, it's extremely useful :)
Anyway, the proposed solutions use twice much memory than a simple for loop...is the compiler smart enougth to optimize this kind of code ?