| 487 | } |
| 488 | |
| 489 | inline std::string comment_out_code_line(int line_num, std::string source) { |
| 490 | size_t beg = 0; |
| 491 | for (int i = 1; i < line_num; ++i) { |
| 492 | beg = source.find("\n", beg) + 1; |
| 493 | } |
| 494 | return (source.substr(0, beg) + "//" + source.substr(beg)); |
| 495 | } |
| 496 | |
| 497 | inline void print_with_line_numbers(std::string const& source) { |
| 498 | int linenum = 1; |