diff options
author | Igor Murashkin <iam@google.com> | 2018-03-22 14:28:07 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2018-08-09 17:04:15 -0700 |
commit | da5396314d890d66fcd38d6cc5c61ab6d37b476c (patch) | |
tree | 10110cbe185cfb37743a75e941fe149e26171134 /Rx/v2/src/rxcpp/operators/rx-group_by.hpp | |
parent | 122c10b47aa429775a58abe86b4240bebc7da4a1 (diff) | |
download | RxCpp-da5396314d890d66fcd38d6cc5c61ab6d37b476c.tar.gz |
Rx: Add support for compiling code without exceptions (-fno-exceptions)
std::exception_ptr usage is replaced with rxcpp::util::error_ptr
which will typedef to std::exception_ptr when exceptions are enabled.
When exceptions are disabled this will typedef to an internal error
type that can retain the "what" error message.
Additionally std::current_exception() and similar usages are replaced
with rxu::current_exception which uses error_ptr instead.
Lastly all try/catch/throw keywords are replaced with either
RXCPP_TRY, RXCPP_CATCH, rxu::throw_exception or similar.
Note that try/catch/throw keywords cause a compilation error with
-fno-exceptions. Trying to access most of the std::*exception* functions
will call std::terminate at runtime.
Tests using exceptions must be disabled by passing --nothrow to the
check2 test runner.
Change-Id: I0b95ae2e323653a17c3b733d165ecf87a014c315
Diffstat (limited to 'Rx/v2/src/rxcpp/operators/rx-group_by.hpp')
-rw-r--r-- | Rx/v2/src/rxcpp/operators/rx-group_by.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-group_by.hpp b/Rx/v2/src/rxcpp/operators/rx-group_by.hpp index 4eadbab..f702fba 100644 --- a/Rx/v2/src/rxcpp/operators/rx-group_by.hpp +++ b/Rx/v2/src/rxcpp/operators/rx-group_by.hpp @@ -195,7 +195,7 @@ struct group_by auto selectedKey = on_exception( [&](){ return this->keySelector(v);}, - [this](std::exception_ptr e){on_error(e);}); + [this](rxu::error_ptr e){on_error(e);}); if (selectedKey.empty()) { return; } @@ -211,13 +211,13 @@ struct group_by auto selectedMarble = on_exception( [&](){ return this->marbleSelector(v);}, - [this](std::exception_ptr e){on_error(e);}); + [this](rxu::error_ptr e){on_error(e);}); if (selectedMarble.empty()) { return; } g->second.on_next(std::move(selectedMarble.get())); } - void on_error(std::exception_ptr e) const { + void on_error(rxu::error_ptr e) const { for(auto& g : state->groups) { g.second.on_error(e); } |