]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | #if __has_include(<source_location>) |
2 | #include <source_location> | |
3 | #endif | |
4 | ||
5 | #ifdef __cpp_lib_source_location | |
6 | using source_location = std::source_location; | |
7 | #elif __has_include(<experimental/source_location>) | |
8 | #include <experimental/source_location> | |
9 | using source_location = std::experimental::source_location; | |
10 | #endif | |
11 | ||
12 | #if defined(__cpp_lib_source_location) || defined(__cpp_lib_experimental_source_location) | |
13 | struct format_info { | |
14 | format_info(source_location loc = source_location::current()) noexcept | |
15 | : loc(loc) | |
16 | { } | |
17 | source_location loc; | |
18 | }; | |
19 | #else | |
20 | struct format_info { }; | |
21 | #endif | |
22 | ||
23 | int main() | |
24 | { | |
25 | format_info fi; | |
26 | } |