tmp/tmpakorzban/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="support.srcloc.class.general">[[support.srcloc.class.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
struct source_location {
|
| 6 |
+
// source location construction
|
| 7 |
+
static consteval source_location current() noexcept;
|
| 8 |
+
constexpr source_location() noexcept;
|
| 9 |
+
|
| 10 |
+
// source location field access
|
| 11 |
+
constexpr uint_least32_t line() const noexcept;
|
| 12 |
+
constexpr uint_least32_t column() const noexcept;
|
| 13 |
+
constexpr const char* file_name() const noexcept;
|
| 14 |
+
constexpr const char* function_name() const noexcept;
|
| 15 |
+
|
| 16 |
+
private:
|
| 17 |
+
uint_least32_t line_; // exposition only
|
| 18 |
+
uint_least32_t column_; // exposition only
|
| 19 |
+
const char* file_name_; // exposition only
|
| 20 |
+
const char* function_name_; // exposition only
|
| 21 |
+
};
|
| 22 |
+
}
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
The type `source_location` meets the *Cpp17DefaultConstructible*,
|
| 26 |
+
*Cpp17CopyConstructible*, *Cpp17CopyAssignable*, *Cpp17Swappable*, and
|
| 27 |
+
*Cpp17Destructible* requirements
|
| 28 |
+
[[utility.arg.requirements]], [[swappable.requirements]]. All of the
|
| 29 |
+
following conditions are `true`:
|
| 30 |
+
|
| 31 |
+
- `is_nothrow_move_constructible_v<source_location>`
|
| 32 |
+
- `is_nothrow_move_assignable_v<source_location>`
|
| 33 |
+
- `is_nothrow_swappable_v<source_location>`
|
| 34 |
+
|
| 35 |
+
[*Note 1*: The intent of `source_location` is to have a small size and
|
| 36 |
+
efficient copying. It is unspecified whether the copy/move constructors
|
| 37 |
+
and the copy/move assignment operators are trivial and/or
|
| 38 |
+
constexpr. — *end note*]
|
| 39 |
+
|
| 40 |
+
The data members `file_name_` and `function_name_` always each refer to
|
| 41 |
+
an NTBS.
|
| 42 |
+
|
| 43 |
+
The copy/move constructors and the copy/move assignment operators of
|
| 44 |
+
`source_location` meet the following postconditions: Given two objects
|
| 45 |
+
`lhs` and `rhs` of type `source_location`, where `lhs` is a copy/move
|
| 46 |
+
result of `rhs`, and where `rhs_p` is a value denoting the state of
|
| 47 |
+
`rhs` before the corresponding copy/move operation, then each of the
|
| 48 |
+
following conditions is `true`:
|
| 49 |
+
|
| 50 |
+
- `strcmp(lhs.file_name(), rhs_p.file_name()) == 0`
|
| 51 |
+
- `strcmp(lhs.function_name(), rhs_p.function_name()) == 0`
|
| 52 |
+
- `lhs.line() == rhs_p.line()`
|
| 53 |
+
- `lhs.column() == rhs_p.column()`
|
| 54 |
+
|