Skip to content

Commit

Permalink
allow default-constructed async_response{
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Aug 23, 2024
1 parent ac8ca10 commit 24305ab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/thallium/async_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class async_response {

private:
margo_instance_ref m_mid;
margo_request m_request;
hg_handle_t m_handle;
bool m_ignore_response;
margo_request m_request = MARGO_REQUEST_NULL;
hg_handle_t m_handle = HG_HANDLE_NULL;
bool m_ignore_response = false;

/**
* @brief Constructor. Made private since async_response
Expand All @@ -53,6 +53,9 @@ class async_response {
}

public:

async_response() = default;

/**
* @brief Copy constructor is deleted.
*/
Expand Down Expand Up @@ -107,6 +110,8 @@ class async_response {
* @return a packed_data containing the response.
*/
packed_data<> wait() {
if(m_handle == HG_HANDLE_NULL)
throw exception("Calling wait on an invalid async_response");
hg_return_t ret;
if(m_request != MARGO_REQUEST_NULL) {
ret = margo_wait(m_request);
Expand Down

0 comments on commit 24305ab

Please sign in to comment.