ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.03k stars 390 forks source link

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

Closed daixtrose closed 4 years ago

daixtrose commented 4 years ago

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