std::is_debugger_present - cppreference.com (original) (raw)
| | | | | -------------------------------------- | | ------------- | | bool is_debugger_present() noexcept; | | (since C++26) |
Attempts to determine if the program is being executed with debugger present.
This function is replaceable.
[edit] Return value
The default version returns an implementation-defined value, which usually represents whether the program is executed under a debugger.
[edit] Notes
The intent of this function is allowing printing out extra output to help diagnose problems, executing extra test code, displaying an extra user interface to help in debugging, etc.
| 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
[edit] See also
[edit] External links
is_debugger_present standardizes many similar existing facilities, e.g.: