5 ms·
Comment toggle: foo(); //* some(); code(); which_you_want_to_comment_out(); // */ other_code(); Code between comments are 'enabled
by feisuzhu 6y ago
Comment toggle:
foo();
//*
some();
code();
which_you_want_to_comment_out();
// */
other_code();
Code between comments are 'enabled' for now, and can be commented out by simply removing a slash in the '//*'.
- sigjuice 6y agoIt is very common to use #if 0 ... #endif for this.
- cperciva 6y agoEven better, #ifdef NOTYET or similar, to help future readers (which may include "you, tomorrow") understand why it's not happening.
- SV_BubbleTime 6y agoFirst example I’ve seen in this entire post that I really like. A lot of the rest of these look like they’re just trying to be clever for the sake of it.
- a1369209993 6y agoThere's also: /** / do_thing(); /*/ do_other(); //*/ which allows quickly toggling between `thing` and `other` while debugging.