Timeline for Method to remove comments from a string line
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 20, 2019 at 18:25 | comment | added | lubgr | Well, the regex approach I posted will definitely be slow... Besides, make sure to read e.g. this thread before editing your question. | |
Mar 20, 2019 at 17:41 | comment | added | user3132457 |
the reason i'm not using regex is that, after removing the comments i run a regex on the string, so if i remove the comments using regex, that'll be 2 regex passes for each string, and i know c++ regex is infamous for its slowness. i know about string_view, but don't have c++17 available. the input "a /* b \n c */ d # e" is supposed to return a \n d (i had a bug and fixed it to return the correct string). and i like the idea to have a comment remover class. i'll update my code respectively and post it again, thanks.
|
|
Mar 20, 2019 at 16:55 | history | edited | lubgr | CC BY-SA 4.0 |
added 201 characters in body
|
Mar 20, 2019 at 16:47 | history | answered | lubgr | CC BY-SA 4.0 |