From 2aa2af0007b7e969845642027c635cd3fd9c8aea Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Wed, 3 May 2023 20:34:02 +0200 Subject: Moved dirs and added codec-json dir --- forstio/core/string_literal.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 forstio/core/string_literal.h (limited to 'forstio/core/string_literal.h') diff --git a/forstio/core/string_literal.h b/forstio/core/string_literal.h deleted file mode 100644 index d530a54..0000000 --- a/forstio/core/string_literal.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -#include - -namespace saw { -/** - * Helper object which creates a templated string from the provided string - * literal. It guarantees compile time uniqueness and thus allows using strings - * in template parameters. - */ -template class string_literal { -public: - constexpr string_literal(const CharT (&input)[N]) noexcept { - for (size_t i = 0; i < N; ++i) { - data[i] = input[i]; - } - } - - std::array data{}; - - constexpr std::string_view view() const noexcept { - return std::string_view{data.data()}; - } - - constexpr bool - operator==(const string_literal &) const noexcept = default; - - template - constexpr bool - operator==(const string_literal &) const noexcept { - return false; - } -}; - -template -constexpr string_literal operator""_key() { - return string_literal{Chars..., '\0'}; -} -} // namespace saw -- cgit v1.2.3