From f0c123ae28b6301cc7dbb3af7141d4e857bb2bca Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 24 Apr 2021 12:48:28 -0700 Subject: [PATCH] init const sharedArray from sequence "cheat" to allow newly allocated const array to be initialized from a sequence. --- src/pvxs/sharedArray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pvxs/sharedArray.h b/src/pvxs/sharedArray.h index f4b2b88..922c285 100644 --- a/src/pvxs/sharedArray.h +++ b/src/pvxs/sharedArray.h @@ -274,7 +274,7 @@ public: shared_array(Iter begin, Iter end) :shared_array(std::distance(begin, end)) { - std::copy(begin, end, this->begin()); + std::copy(begin, end, const_cast<_E_non_const*>(this->begin())); } //! @brief Allocate (with new[]) a new vector of size c