Index: uspace/lib/cpp/include/__bits/thread/future.hpp
===================================================================
--- uspace/lib/cpp/include/__bits/thread/future.hpp	(revision 396b2343d75894917de50285dd82e600ceb0c3e8)
+++ uspace/lib/cpp/include/__bits/thread/future.hpp	(revision 0f43be54a81e8b4daef0368d9b12560336d1ef42)
@@ -192,9 +192,9 @@
 
     template<class R>
-    class future<R&>: public aux::future_base<R&>
+    class future<R&>: public aux::future_base<R*>
     {
         public:
             future() noexcept
-                : aux::future_base<R&>{}
+                : aux::future_base<R*>{}
             { /* DUMMY BODY */ }
 
@@ -202,9 +202,9 @@
 
             future(future&& rhs) noexcept
-                : aux::future_base<R&>{move(rhs.state_)}
-            { /* DUMMY BODY */ }
-
-            future(aux::shared_state<R&>* state)
-                : aux::future_base<R&>{state}
+                : aux::future_base<R*>{move(rhs.state_)}
+            { /* DUMMY BODY */ }
+
+            future(aux::shared_state<R*>* state)
+                : aux::future_base<R*>{state}
             { /* DUMMY BODY */ }
 
@@ -227,5 +227,6 @@
                     this->state_->throw_stored_exception();
 
-                return this->state_->get();
+                assert(this->state_->get());
+                return *this->state_->get();
             }
     };
Index: uspace/lib/cpp/include/__bits/thread/promise.hpp
===================================================================
--- uspace/lib/cpp/include/__bits/thread/promise.hpp	(revision 396b2343d75894917de50285dd82e600ceb0c3e8)
+++ uspace/lib/cpp/include/__bits/thread/promise.hpp	(revision 0f43be54a81e8b4daef0368d9b12560336d1ef42)
@@ -75,5 +75,5 @@
                 {
                     abandon_state_();
-                    promise_base{std::move(rhs)}.swap(*this);
+                    promise_base{move(rhs)}.swap(*this);
 
                     return *this;
@@ -85,9 +85,4 @@
                 {
                     std::swap(state_, other.state_);
-                }
-
-                future<R> get_future()
-                {
-                    return future<R>{state_};
                 }
 
@@ -165,4 +160,9 @@
             promise& operator=(const promise&) = delete;
 
+            future<R> get_future()
+            {
+                return future<R>{this->state_};
+            }
+
             void set_value(const R& val)
             {
@@ -190,5 +190,5 @@
                 }
 
-                this->state_->set_value(std::forward<R>(val), true);
+                this->state_->set_value(forward<R>(val), true);
             }
 
@@ -219,5 +219,5 @@
                 }
 
-                this->state_->set_value(std::forward<R>(val), false);
+                this->state_->set_value(forward<R>(val), false);
                 // TODO: schedule it to be set as ready when thread exits
             }
@@ -225,14 +225,14 @@
 
     template<class R>
-    class promise<R&>: public aux::promise_base<R>
-    { // TODO: I'm afraid we will need aux::shared_state<R&> specialization for this :/
+    class promise<R&>: public aux::promise_base<R*>
+    {
         public:
             promise()
-                : aux::promise_base<R&>{}
+                : aux::promise_base<R*>{}
             { /* DUMMY BODY */ }
 
             template<class Allocator>
             promise(allocator_arg_t, const Allocator& a)
-                : aux::promise_base<R&>{}
+                : aux::promise_base<R*>{}
             {
                 // TODO: Use the allocator.
@@ -240,5 +240,5 @@
 
             promise(promise&& rhs) noexcept
-                : aux::promise_base<R&>{move(rhs)}
+                : aux::promise_base<R*>{move(rhs)}
             { /* DUMMY BODY */ }
 
@@ -250,4 +250,38 @@
 
             promise& operator=(const promise&) = delete;
+
+            future<R&> get_future()
+            {
+                return future<R&>{this->state_};
+            }
+
+            void set_value(R& val)
+            {
+                if (!this->state_)
+                    throw future_error{make_error_code(future_errc::no_state)};
+                if (this->state_->is_set())
+                {
+                    throw future_error{
+                        make_error_code(future_errc::promise_already_satisfied)
+                    };
+                }
+
+                this->state_->set_value(&val, true);
+            }
+
+            void set_value_at_thread_exit(R& val)
+            {
+                if (!this->state_)
+                    throw future_error{make_error_code(future_errc::no_state)};
+                if (this->state_->is_set())
+                {
+                    throw future_error{
+                        make_error_code(future_errc::promise_already_satisfied)
+                    };
+                }
+
+                this->state_->set_value(&val, false);
+                // TODO: schedule it to be set as ready when thread exits
+            }
     };
 
@@ -278,4 +312,9 @@
 
             promise& operator=(const promise&) = delete;
+
+            future<void> get_future()
+            {
+                return future<void>{this->state_};
+            }
 
             void set_value()
