Allow creating ph::phrase from rpl::producer.

This commit is contained in:
John Preston 2019-10-14 17:37:19 +04:00
parent 40d7581c36
commit 9afafd34eb
2 changed files with 5 additions and 0 deletions

View file

@ -22,6 +22,10 @@ phrase::phrase(const QString &initial) : value(initial) {
}
}
phrase::phrase(rpl::producer<QString> initial) : value(std::move(initial)) {
}
now_t start_phrase_count() {
PhraseCounter() = 1;
return now;

View file

@ -26,6 +26,7 @@ struct phrase {
phrase(const char (&initial)[Size])
: phrase(QString::fromUtf8(initial, Size - 1)) {
}
explicit phrase(rpl::producer<QString> initial);
template <typename P = I, typename = Result<P>>
Result<P> operator()(ph::now_t, P p = P()) const {