Files
cppdraft_translate/cppdraft/stacktrace/entry/query.md
2025-10-25 03:02:53 +03:00

2.6 KiB
Raw Blame History

[stacktrace.entry.query]

19 Diagnostics library [diagnostics]

19.6 Stacktrace [stacktrace]

19.6.3 Class stacktrace_entry [stacktrace.entry]

19.6.3.4 Query [stacktrace.entry.query]

1

#

[Note 1:

All the stacktrace_entry query functions treat errors other than memory allocation errors as “no information available” and do not throw in that case.

— end note]

🔗

string description() const;

2

#

Returns: A description of the evaluation represented by *this, or an empty string.

3

#

Throws: bad_alloc if memory for the internal data structures or the resulting string cannot be allocated.

🔗

string source_file() const;

4

#

Returns: The presumed or actual name of the source file ([cpp.predefined]) that lexically contains the expression or statement whose evaluation is represented by *this, or an empty string.

5

#

Throws: bad_alloc if memory for the internal data structures or the resulting string cannot be allocated.

🔗

uint_least32_t source_line() const;

6

#

Returns: 0, or a 1-based line number that lexically relates to the evaluation represented by *this.

If source_file returns the presumed name of the source file, returns the presumed line number; if source_file returns the actual name of the source file, returns the actual line number.

7

#

Throws: bad_alloc if memory for the internal data structures cannot be allocated.