diff --git a/src/openvic-simulation/core/string/StringLiteral.hpp b/src/openvic-simulation/core/string/StringLiteral.hpp index 8b5c1687e..300da1bc6 100644 --- a/src/openvic-simulation/core/string/StringLiteral.hpp +++ b/src/openvic-simulation/core/string/StringLiteral.hpp @@ -57,6 +57,13 @@ namespace OpenVic { } } + [[nodiscard]] consteval string_literal(std::string_view string) { + if (string.size() != N) { + unreachable(); + } + std::copy_n(string.begin(), N, _data); + } + [[nodiscard]] constexpr string_literal(value_type c) noexcept { _data[0] = c; _data[size()] = '\0';