-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathSourceLocation.h
More file actions
38 lines (35 loc) · 777 Bytes
/
SourceLocation.h
File metadata and controls
38 lines (35 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <string>
#if __cplusplus >= 202002L
#include <source_location>
#endif
namespace Linter
{
#if __cplusplus >= 202002L
using SourceLocation = std::source_location;
#else
struct SourceLocation
{
struct Location
{
unsigned int line() const noexcept
{
return 0;
}
const char *file_name() const noexcept
{
return "";
}
const char *function_name() const noexcept
{
return "";
}
};
static Location current()
{
return {};
}
};
#endif
using SourceLocationCurrent = decltype(SourceLocation::current());
} // namespace Linter