From: Hans Fugal Date: Thu, 2 Jul 2015 18:43:42 +0000 (-0700) Subject: nice error message if you try to Future X-Git-Tag: v0.49.0~6 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=8fe0a63e56fa5e9999d6cb793a0b8ddb31241c73 nice error message if you try to Future 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 --- diff --git a/folly/futures/detail/Core.h b/folly/futures/detail/Core.h index f0018862..a01285fa 100644 --- a/folly/futures/detail/Core.h +++ b/folly/futures/detail/Core.h @@ -74,6 +74,8 @@ enum class State : uint8_t { /// time there won't be any problems. template class Core { + static_assert(!std::is_void::value, + "void futures are not supported. Use Unit instead."); public: /// 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