diff --git a/Telegram/SourceFiles/info/info_content_widget.cpp b/Telegram/SourceFiles/info/info_content_widget.cpp index 5db553a5e..585543b07 100644 --- a/Telegram/SourceFiles/info/info_content_widget.cpp +++ b/Telegram/SourceFiles/info/info_content_widget.cpp @@ -127,15 +127,16 @@ Ui::RpWidget *ContentWidget::doSetInnerWidget( _innerWrap ? _innerWrap->padding() : style::margins())); _innerWrap->move(0, 0); + // MSVC BUG + REGRESSION rpl::mappers::tuple :( rpl::combine( _scroll->scrollTopValue(), _scroll->heightValue(), - _innerWrap->entity()->desiredHeightValue(), - tuple(_1, _1 + _2, _3) + _innerWrap->entity()->desiredHeightValue() ) | rpl::start_with_next([this]( int top, - int bottom, + int height, int desired) { + const auto bottom = top + height; _innerDesiredHeight = desired; _innerWrap->setVisibleTopBottom(top, bottom); _scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0)); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 44c7dbaf6..71e65e9c1 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -296,6 +296,7 @@ MainWidget::MainWidget( checkFloatPlayerVisibility(); }); + // MSVC BUG + REGRESSION rpl::mappers::tuple :( using namespace rpl::mappers; _controller->activeChatValue( ) | rpl::map([](Dialogs::Key key) { @@ -303,7 +304,11 @@ MainWidget::MainWidget( auto canWrite = peer ? Data::CanWriteValue(peer) : rpl::single(false); - return std::move(canWrite) | rpl::map(tuple(key, _1)); + return std::move( + canWrite + ) | rpl::map([=](bool can) { + return std::make_tuple(key, can); + }); }) | rpl::flatten_latest( ) | rpl::start_with_next([this](Dialogs::Key key, bool canWrite) { updateThirdColumnToCurrentChat(key, canWrite); diff --git a/Telegram/SourceFiles/media/player/media_player_panel.cpp b/Telegram/SourceFiles/media/player/media_player_panel.cpp index 2c4500750..0711b77a1 100644 --- a/Telegram/SourceFiles/media/player/media_player_panel.cpp +++ b/Telegram/SourceFiles/media/player/media_player_panel.cpp @@ -301,12 +301,13 @@ void Panel::refreshList() { _scroll->scrollToY(newScrollTop); }, weak->lifetime()); + // MSVC BUG + REGRESSION rpl::mappers::tuple :( using namespace rpl::mappers; rpl::combine( _scroll->scrollTopValue(), - _scroll->heightValue(), - tuple(_1, _1 + _2) - ) | rpl::start_with_next([=](int top, int bottom) { + _scroll->heightValue() + ) | rpl::start_with_next([=](int top, int height) { + const auto bottom = top + height; weak->setVisibleTopBottom(top, bottom); }, weak->lifetime()); diff --git a/Telegram/SourceFiles/rpl/operators_tests.cpp b/Telegram/SourceFiles/rpl/operators_tests.cpp index bd3b73962..548057f44 100644 --- a/Telegram/SourceFiles/rpl/operators_tests.cpp +++ b/Telegram/SourceFiles/rpl/operators_tests.cpp @@ -367,6 +367,15 @@ TEST_CASE("basic operators tests", "[rpl::operators]") { using namespace mappers; + // MSVC BUG + REGRESSION rpl::mappers::tuple :( + //combine( + // a.events(), + // b.events(), + // tuple(_1, _1 + _2) + //) | rpl::start_with_next([=](int a, int a_plus_b) { + // *sum += std::to_string(a * a_plus_b); + //}, lifetime); + combine( a.events(), b.events(), @@ -384,6 +393,9 @@ TEST_CASE("basic operators tests", "[rpl::operators]") { c.fire(6); } REQUIRE(*sum == "16192225"); + + // MSVC BUG + REGRESSION rpl::mappers::tuple :( + //REQUIRE(*sum == "3162419362225"); } SECTION("after_next test") { diff --git a/Telegram/SourceFiles/ui/abstract_button.h b/Telegram/SourceFiles/ui/abstract_button.h index fe613578c..26a375517 100644 --- a/Telegram/SourceFiles/ui/abstract_button.h +++ b/Telegram/SourceFiles/ui/abstract_button.h @@ -43,7 +43,7 @@ public: _clickedCallback = std::move(callback); } - auto clicks() const { + rpl::producer<> clicks() const { return _clicks.events(); } template