MCPcopy Create free account
hub / github.com/SheafificationOfG/based-cpp / StringLiteral

Class StringLiteral

gil/gil.impl.hpp:333–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331namespace string {
332
333template <unsigned n> struct StringLiteral {
334 char str[n + 1];
335 constexpr StringLiteral(char const *ptr) noexcept {
336 for (unsigned i = 0; i < n; ++i)
337 str[i] = ptr[i];
338 str[n] = '\0';
339 }
340 static constexpr unsigned size = n;
341
342 constexpr auto operator[](unsigned idx) const noexcept { return str[idx]; }
343};
344
345template <unsigned n> StringLiteral(char const (&)[n]) -> StringLiteral<n - 1>;
346

Callers 1

Join<String<cs...>>Class · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected