| 7 | |
| 8 | namespace NPrivate { |
| 9 | struct TStaticBuf { |
| 10 | constexpr TStaticBuf(const char* data, unsigned len) noexcept |
| 11 | : Data(data) |
| 12 | , Len(len) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | template <class T> |
| 17 | constexpr T As() const noexcept { |
| 18 | return T(Data, Len); |
| 19 | } |
| 20 | |
| 21 | template <class T> |
| 22 | constexpr operator T() const noexcept { |
| 23 | return this->As<T>(); |
| 24 | } |
| 25 | |
| 26 | const char* Data; |
| 27 | unsigned Len; |
| 28 | }; |
| 29 | |
| 30 | #define STATIC_BUF(x) ::NPrivate::TStaticBuf(x, sizeof(x) - 1) |
| 31 |
no outgoing calls
no test coverage detected