My omnium-gatherom of scripts and source code.
1#include <iostream>
2
3static void operator ""_break (const char* str, [[maybe_unused]] std::size_t) {
4 std::cout << std::endl << "Reached breakpoint: " << str << std::endl;
5 std::cout << "[Press Enter to continue]";
6 std::cin.ignore();
7}
8
9auto main() noexcept -> int
10{
11 std::cout << "1 + 1 = " << ("before sum"_break, 1 + 1)
12 << std::endl;
13 "after sum"_break;
14 return 0;
15}