Advertisement
Tkap1

Untitled

Oct 23rd, 2023
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #define foreach_ptr__(a, index_name, element_name, array) if(0) finished##a: ; else for(auto element_name = &(array).elements[0];;) if(1) goto body##a; else while(1) if(1) goto finished##a; else body##a: for(int index_name = 0; index_name < (array).count && (bool)(element_name = &(array)[index_name]); index_name++)
  2. #define foreach_ptr_(a, index_name, element_name, array) foreach_ptr__(a, index_name, element_name, array)
  3. #define foreach_ptr(index_name, element_name, array) foreach_ptr_(__LINE__, index_name, element_name, array)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement