From 61a3da8697f341f16b4fb252553af0d0c4c6e4bc Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 7 Feb 2019 04:01:02 +0100 Subject: [PATCH] Implement pmix::value copy ctor --- fairmq/plugins/PMIx/PMIx.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fairmq/plugins/PMIx/PMIx.hpp b/fairmq/plugins/PMIx/PMIx.hpp index ff4f55de..5332b79d 100644 --- a/fairmq/plugins/PMIx/PMIx.hpp +++ b/fairmq/plugins/PMIx/PMIx.hpp @@ -76,7 +76,19 @@ struct proc : pmix_proc_t struct value : pmix_value_t { value() { PMIX_VALUE_CONSTRUCT(static_cast(this)); } - ~value() { /*PMIX_VALUE_DESTRUCT(static_cast(this));*/ } + ~value() { PMIX_VALUE_DESTRUCT(static_cast(this)); } + + value(const value& rhs) + { + LOG(warn) << "copy ctor"; + status rc; + auto lhs(static_cast(this)); + PMIX_VALUE_XFER(rc, lhs, static_cast(const_cast(&rhs))); + + if (rc != PMIX_SUCCESS) { + throw runtime_error("pmix::value copy ctor failed: rc=" + rc); + } + } // template // value(const T* val, data_type dt)