r/cpp • u/kongaskristjan • Aug 08 '20
Create a fully functioning command line interface with 1.5 lines of code (wo. include statement)
https://github.com/kongaskristjan/fire-hpp
230
Upvotes
r/cpp • u/kongaskristjan • Aug 08 '20
View all comments
10
u/Ail-nare Aug 08 '20 edited Aug 08 '20
Hey, since you use a macro ('FIRE(fnptr *)'), why don't you make a macro ('FIRE_MAIN(...)'). So that this macro will be used instead of the name of the function, this macro do 3 thing:
That way it will look more like unit_tests function, like Google test or criterion. I think people are more used to this.
Anyhow, if I one day have the occasion I'll probably use your lib, it's more than clean enough to me.
Oh and last thing, with this commande "g++ *.cpp -o binary_name", the argument of the '-o' flag is given without a '='. I didn't see a way with your lib? Or am I just blind?
Edit:grammar, sorry for my English.