std::basic_stacktrace<Allocator>::empty

Checks if the stacktrace has no stacktrace entries.

# Declarations

bool empty() const noexcept;

(since C++23)

# Return value

true if the stacktrace is empty, false otherwise.

# Example

#include <stacktrace>
#include <iostream>
 
int main()
{
    std::cout << std::boolalpha;
    std::stacktrace bktr;
    std::cout << "Initially, bktr.empty(): " << bktr.empty() << '\n';
 
    bktr = std::stacktrace::current();
    std::cout << "After getting entries, bktr.empty(): " << bktr.empty() << '\n';
}

# See also