Commit 8756e4ce authored by Xavier Thompson's avatar Xavier Thompson

WIP Delete promise.hpp

parent 09e7f7a0
#ifndef __PROMISE_HPP__
#define __PROMISE_HPP__
#include <type_traits>
#include <result.hpp>
namespace typon
{
template <typename T>
struct promise
{
result<T>* _result;
template <typename U>
void return_value(U&& expr) noexcept(std::is_nothrow_constructible_v<T, U&&>)
{
_result->return_value(std::forward<U>(expr));
}
void unhandled_exception() noexcept
{
_result->unhandled_exception();
}
};
template <>
struct promise<void>
{
result<void>* _result;
void return_void() noexcept {}
void unhandled_exception() noexcept
{
_result->unhandled_exception();
}
};
}
#endif // __PROMISE_HPP__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment