Ignore:
Timestamp:
2019-07-01T13:19:05Z (5 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d299c93
Parents:
396b234
Message:

cpp: implemented promise and future for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/thread/future.hpp

    r396b234 r0f43be5  
    192192
    193193    template<class R>
    194     class future<R&>: public aux::future_base<R&>
     194    class future<R&>: public aux::future_base<R*>
    195195    {
    196196        public:
    197197            future() noexcept
    198                 : aux::future_base<R&>{}
     198                : aux::future_base<R*>{}
    199199            { /* DUMMY BODY */ }
    200200
     
    202202
    203203            future(future&& rhs) noexcept
    204                 : aux::future_base<R&>{move(rhs.state_)}
    205             { /* DUMMY BODY */ }
    206 
    207             future(aux::shared_state<R&>* state)
    208                 : aux::future_base<R&>{state}
     204                : aux::future_base<R*>{move(rhs.state_)}
     205            { /* DUMMY BODY */ }
     206
     207            future(aux::shared_state<R*>* state)
     208                : aux::future_base<R*>{state}
    209209            { /* DUMMY BODY */ }
    210210
     
    227227                    this->state_->throw_stored_exception();
    228228
    229                 return this->state_->get();
     229                assert(this->state_->get());
     230                return *this->state_->get();
    230231            }
    231232    };
Note: See TracChangeset for help on using the changeset viewer.