@N
Size: a a a
@N
A
М
VM
LA
AL
PO
@N
AG

VM
VM
#include <array>
#include <iostream>
#include <string>
consteval auto Foo() {
std::string s = "hello world";
std::array<char, sizeof("hello world")> result;
for (int i = 0; auto& v : result) {
v = s[i++];
}
return result;
}
int main() {
for (auto value : Foo()) {
std::cout << value << std::endl;
}
}
К сожалению через constinit нельзя инстанцировать строку, только создать и использовать внутри constexpr функции, так что перекладывается в array.ЗВ
ЕО
PO