std::breakpoint_if_debugging
From cppreference.com
 
 
 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
Diagnostics library 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
(until C++20*)
  (C++17)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
 Exception handling failures
(C++11)
(until C++17*)
(until C++17*)
(until C++17*)
(until C++17*)
(TM TS)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++26)
breakpoint_if_debugging
(C++26)
(C++26)
Defined in header 
 
 
<debugging> 
 void breakpoint_if_debugging() noexcept;
 
 (since C++26) 
Conditional breakpoint: 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. Acts as a no-op otherwise.
Formally, the behavior of this function is completely implementation-defined. Equivalent to
if (std::is_debugger_present ())
    std::breakpoint ();.
[edit] Notes
| Feature-test macro | Value | Std | Feature | 
|---|---|---|---|
| __cpp_lib_debugging | 202311L | (C++26) | Debugging support library | 
| 202403L | (C++26) | Replaceable std::is_debugger_present | 
[edit] Example
 This section is incomplete
Reason: no example
Reason: no example