Commit 8fe0a63e authored by Hans Fugal's avatar Hans Fugal Committed by Sara Golemon

nice error message if you try to Future<void>

Summary: If you try to make a future or promise of `void`, you will get this nice error message telling you to use `Unit` instead.

Reviewed By: @djwatson

Differential Revision: D2211239
parent 124b2552
...@@ -74,6 +74,8 @@ enum class State : uint8_t { ...@@ -74,6 +74,8 @@ enum class State : uint8_t {
/// time there won't be any problems. /// time there won't be any problems.
template<typename T> template<typename T>
class Core { class Core {
static_assert(!std::is_void<T>::value,
"void futures are not supported. Use Unit instead.");
public: public:
/// This must be heap-constructed. There's probably a way to enforce that in /// This must be heap-constructed. There's probably a way to enforce that in
/// code but since this is just internal detail code and I don't know how /// code but since this is just internal detail code and I don't know how
......
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