Skip to content

Instantly share code, notes, and snippets.

View n1f7's full-sized avatar

Elisey Shemyakin n1f7

View GitHub Profile
@n1f7
n1f7 / string.hpp
Created May 17, 2021 08:02
Capture NTBS literal as a character array that could be inherited from
#include <cstddef>
#include <utility>
template <const char *str, std::size_t I = 0, char ch = str[I]>
inline constexpr auto strlen = strlen<str, I + 1>;
template <const char *str, std::size_t I>
inline constexpr auto strlen<str, I, '\0'> = I;
namespace _imp {