[code]encode[/code] ниже представлена упрощенная версия преобразования, над которым я работаю (запустите его на godbolt): [code]#include #include #include
int main() { static constexpr auto arr = std::array{1, 2, 3, 4, 5, 6, 7}; static constexpr auto encode = std::views::chunk(3) | std::views::transform([](auto chunk) { std::array a{}; auto i = 0; for (const auto j : chunk) { a.at(i++) = j; } a.at(3) = a.at(0); return a; }) | std::views::join; auto encoded = arr | encode;