Skip to content

Commit

Permalink
Merge pull request #1874 from STEllAR-GROUP/shared_ptr-fixme
Browse files Browse the repository at this point in the history
Address long standing FIXME on using `std::unique_ptr` with incomplet…
  • Loading branch information
hkaiser committed Nov 23, 2015
2 parents a872302 + fec745e commit db1929a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion hpx/runtime/agas/request.hpp
Expand Up @@ -20,6 +20,8 @@
#include <hpx/runtime/parcelset/locality.hpp>
#include <hpx/runtime/serialization/serialize.hpp>

#include <memory>

// The number of types that the request's variant can represent.
#define HPX_AGAS_REQUEST_SUBTYPES 13

Expand Down Expand Up @@ -122,6 +124,8 @@ struct HPX_EXPORT request
, hpx::id_type result_lco
);

~request();

///////////////////////////////////////////////////////////////////////////
// copy constructor
request(
Expand Down Expand Up @@ -240,7 +244,7 @@ struct HPX_EXPORT request
HPX_SERIALIZATION_SPLIT_MEMBER()

namespace_action_code mc; //-V707
boost::shared_ptr<request_data> data;
std::unique_ptr<request_data> data;
};

}}
Expand Down
7 changes: 4 additions & 3 deletions hpx/runtime/agas/response.hpp
Expand Up @@ -23,6 +23,7 @@
#include <boost/variant.hpp>
#include <boost/mpl/at.hpp>

#include <memory>
#include <numeric>

namespace hpx { namespace agas
Expand Down Expand Up @@ -113,6 +114,8 @@ struct HPX_EXPORT response
, error status_ = success
);

~response();

///////////////////////////////////////////////////////////////////////////
// copy constructor
response(
Expand Down Expand Up @@ -220,9 +223,7 @@ struct HPX_EXPORT response

namespace_action_code mc; //-V707
error status;

// FIXME: std::unique_ptr doesn't seem to work with incomplete types
boost::shared_ptr<response_data> data;
std::unique_ptr<response_data> data;
};

}
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/agas/request.cpp
Expand Up @@ -382,6 +382,9 @@ namespace hpx { namespace agas
HPX_ASSERT(type_ == symbol_ns_on_event);
}

request::~request()
{}

///////////////////////////////////////////////////////////////////////////
// copy constructor
request::request(
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/agas/response.cpp
Expand Up @@ -366,6 +366,9 @@ namespace hpx { namespace agas
// TODO: verification of namespace_action_code
}

response::~response()
{}

response::response(
response const& other
)
Expand Down

0 comments on commit db1929a

Please sign in to comment.