Skip to content

behavior<T> and replay<.., T>: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 #526

@daixtrose

Description

@daixtrose

Compiling master with g++-9 (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102 with -Wall -Wextra -Werror -Wunused -std=gnu++2a yields

/some/path/build/_deps/rxcpp-src/Rx/v2/src/rxcpp/subjects/rx-behavior.hpp:94:43: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
   94 |         return make_observable_dynamic<T>([=](subscriber<T> o){
      |                                           ^
/some/path/build/_deps/rxcpp-src/Rx/v2/src/rxcpp/subjects/rx-behavior.hpp:94:43: note: add explicit ‘this’ or ‘*this’ capture
[...]
/some/path/build/_deps/rxcpp-src/Rx/v2/src/rxcpp/subjects/rx-replaysubject.hpp:172:54: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  172 |         auto observable = make_observable_dynamic<T>([=](subscriber<T> o){
      |                                                      ^
/some/path/build/_deps/rxcpp-src/Rx/v2/src/rxcpp/subjects/rx-replaysubject.hpp:172:54: note: add explicit ‘this’ or ‘*this’ capture
cc1plus: all warnings being treated as errors
_deps/rxcpp-build/build/test/CMakeFiles/rxcpp_test_zip.dir/build.make:65: recipe for target '_deps/rxcpp-build/build/test/CMakeFiles/rxcpp_test_zip.dir/operators/zip.cpp.o' failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions