Commit e23a4b1d authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Forbid co_error with empty exception_wrapper

Summary: [Folly] Forbid `co_error` with empty `exception_wrapper`.

Reviewed By: lewissbaker

Differential Revision: D19172250

fbshipit-source-id: 5ffa7502eb97b6a084be3112b17f29bad2d96a0f
parent 73e26d77
......@@ -16,6 +16,7 @@
#pragma once
#include <cassert>
#include <type_traits>
#include <folly/ExceptionWrapper.h>
......@@ -32,7 +33,9 @@ class co_error {
int> = 0>
explicit co_error(A&&... a) noexcept(
std::is_nothrow_constructible<exception_wrapper, A...>::value)
: ex_(static_cast<A&&>(a)...) {}
: ex_(static_cast<A&&>(a)...) {
assert(ex_);
}
const exception_wrapper& exception() const {
return ex_;
......
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