Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ugh. Multi-line macro.

how about #define PUSH_BACK(a,x,t) push_back(a,&x,sizeof(t))

No multi-evaluation problems or other madness.

Edit: Actually that won't work for expressions. So

#define PUSH_BACK(a,x,t) do { t tmp = x; push_back(a,&tmp,sizeof t) } while(0)

slightly better.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: