From 9afafd34eba12e5b1cad85f2daa373811fd67d65 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Oct 2019 17:37:19 +0400 Subject: [PATCH] Allow creating ph::phrase from rpl::producer. --- ui/ph.cpp | 4 ++++ ui/ph.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ui/ph.cpp b/ui/ph.cpp index a0b19f1..620db93 100644 --- a/ui/ph.cpp +++ b/ui/ph.cpp @@ -22,6 +22,10 @@ phrase::phrase(const QString &initial) : value(initial) { } } +phrase::phrase(rpl::producer initial) : value(std::move(initial)) { +} + + now_t start_phrase_count() { PhraseCounter() = 1; return now; diff --git a/ui/ph.h b/ui/ph.h index 2df9fd6..14ab1d2 100644 --- a/ui/ph.h +++ b/ui/ph.h @@ -26,6 +26,7 @@ struct phrase { 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 {