// This file is part of Desktop App Toolkit, // a set of libraries for developing nice desktop applications. // // For license and copyright information please follow this link: // https://github.com/desktop-app/legal/blob/master/LEGAL // #pragma once namespace ph { struct now_t { }; inline constexpr auto now = now_t(); struct I { QString operator()(const QString &value) const { return value; }; }; template using Result = decltype(std::declval

()(QString())); struct phrase { phrase(const QString &initial); template phrase(const char (&initial)[Size]) : phrase(QString::fromUtf8(initial, Size - 1)) { } explicit phrase(rpl::producer initial); template > Result

operator()(ph::now_t, P p = P()) const { return p(value.current()); }; template > rpl::producer> operator()(P p = P()) const { return value.value() | rpl::map(p); }; rpl::variable value; }; now_t start_phrase_count(); now_t check_phrase_count(int count); namespace details { template using phrase_value_array = std::array< std::pair, rpl::producer>, Count>; template void set_values(phrase_value_array &&data) { for (auto &[single, value] : data) { single->value = std::move(value); } } } // namespace details } // namespace ph