std::is_debugger_present

Header: <debugging>

Attempts to determine if the program is being executed with debugger present.

# Declarations

bool is_debugger_present() noexcept;

(since C++26)

# Return value

The default version returns true if, to the best of its knowledge, the program is executed under a debugger.

# 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.

This function standardizes many similar existing facilities: under_debugger from boost.test, IsDebuggerPresent() from Win32 API, isDebuggerActive from Catch2, IsDebuggerPresent from Unreal Engine, etc.

# Example

This section is incompleteReason: no example

# See also