Skip to content

Commit 24305ab

Browse files
committed
allow default-constructed async_response{
1 parent ac8ca10 commit 24305ab

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

include/thallium/async_response.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class async_response {
3030

3131
private:
3232
margo_instance_ref m_mid;
33-
margo_request m_request;
34-
hg_handle_t m_handle;
35-
bool m_ignore_response;
33+
margo_request m_request = MARGO_REQUEST_NULL;
34+
hg_handle_t m_handle = HG_HANDLE_NULL;
35+
bool m_ignore_response = false;
3636

3737
/**
3838
* @brief Constructor. Made private since async_response
@@ -53,6 +53,9 @@ class async_response {
5353
}
5454

5555
public:
56+
57+
async_response() = default;
58+
5659
/**
5760
* @brief Copy constructor is deleted.
5861
*/
@@ -107,6 +110,8 @@ class async_response {
107110
* @return a packed_data containing the response.
108111
*/
109112
packed_data<> wait() {
113+
if(m_handle == HG_HANDLE_NULL)
114+
throw exception("Calling wait on an invalid async_response");
110115
hg_return_t ret;
111116
if(m_request != MARGO_REQUEST_NULL) {
112117
ret = margo_wait(m_request);

0 commit comments

Comments
 (0)