std::breakp...f_debugging(3)
okay so bestie, welcome to the C++ Standard Libary manual β the header shows it as std::breakp...f_debugging(3) because truncation ate the rest π, but today's main character is std::breakpoint_if_debugging. let's get into it π
π NAME π
std::breakpoint_if_debugging β literally std::breakpoint_if_debugging, that's the name, periodt.
β¨ Synopsis β¨
Defined in header <debugging>:
void breakpoint_if_debugging() noexcept; (since C++26)
It's a conditional breakpoint: it attempts to temporarily halt the execution of the program and transfer control to the debugger if it were able to determine that the debugger is present. Otherwise? No-op city. Acts as a no-op otherwise π«Ά
Formally, the behavior of this function is completely implementation-defined.
Equivalent to this exact vibe:
if (std::is_debugger_present())
std::breakpoint();
π Notes π
Feature-test macro tea β:
__cpp_lib_debugging=202311Lβ Std:(C++26), Feature: Debugging support library__cpp_lib_debugging=202403Lβ Std:(C++26), Feature: Replaceablestd::is_debugger_present
πΈ Example πΈ
This section is incomplete π Reason: no example
π¦ See also π¦
is_debugger_presentβ checks whether a program is running under the control of a debugger. (C++26) (function)breakpointβ pauses the running program when called. (C++26) (function)
ποΈ Category ποΈ
- Todo no example
mwah π source is http://cppreference.com, date 2024.06.10, and the footer version/slug is std::breakp...f_debugging(3) β that's the whole page, bestie, go debug something cute ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms