#pragma once #include "statusline_subscriber_adapter.hpp" #include template StatusLineSubscriberAdapter::StatusLineSubscriberAdapter( std::shared_ptr status_manager, std::string (*format_func)(std::size_t section_index, const Context &context), const std::vector §ions ) noexcept : _status_manager(std::move(status_manager)), _format_func(format_func), _sections(sections) { } template void StatusLineSubscriberAdapter::update(const Context &context) noexcept { for (std::size_t index = 0; const auto §ion : _sections) { auto status = _format_func(index, context); _status_manager->set_section_body(_sections[index], status); index++; } }