You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The field access macros (both develop and unstable) can be greatly simplified using the design below:
template <int x = 0, int y = 0> voidfun() {
printf("static x:%d static y:%d\n", x, y);
}
template <int y = 0> voidfun(int x) {
printf("dynamic x:%d static y:%d\n", x, y);
}
voidfun(int x, int y) {
printf("dynamic x:%d dynamic y:%d\n", x, y);
}
#definefun_static(...) fun<__VA_ARGS__>()
#definefun_dynamic(...) fun(__VA_ARGS__)
Notes
I investigated compiler level discovery of static/dynamic value, and no solutions (even C++2a) were viable. The current user-level choice between f1(0,0) and f1_dyn(dx,dy), will be kept.
The text was updated successfully, but these errors were encountered:
The field access macros (both develop and unstable) can be greatly simplified using the design below:
Notes
I investigated compiler level discovery of static/dynamic value, and no solutions (even C++2a) were viable. The current user-level choice between
f1(0,0)
andf1_dyn(dx,dy)
, will be kept.The text was updated successfully, but these errors were encountered: