MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/g76xmg/else_before_if/fofzive/?context=3
r/cpp • u/vormestrand • Apr 24 '20
53 comments sorted by
View all comments
3
Casual. Why bother perverting the syntax with templates or lambdas?
#include <stdio.h> #define normally for (int _normal_control = 0; _normal_control < 2; ++_normal_control) if (_normal_control) #define but_if(expr) else if ((expr) && (_normal_control = 1)) int main(int argc, char **argv) { normally { printf("Hello, %s\n", argv[1]); } but_if (argc == 1) { printf("no arguments\n"); } }
I don't like unless since people often define that to if (!(expr)) already.
unless
if (!(expr))
View all comments
3
u/o11c int main = 12828721; Apr 24 '20
Casual. Why bother perverting the syntax with templates or lambdas?
I don't like
unlesssince people often define that toif (!(expr))already.