Skip to content

Commit

Permalink
Fix unique_ptr of PUP::able types (#3599)
Browse files Browse the repository at this point in the history
  • Loading branch information
jszaday committed Apr 21, 2022
1 parent 6b3b42c commit 243d32d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/pup_stl.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,12 @@ using Requires = typename requires_impl<

template <typename T, Requires<std::is_base_of<PUP::able, T>::value> = nullptr>
inline void pup(PUP::er& p, std::unique_ptr<T>& t) {
T* t1 = nullptr;
PUP::able* t1 = nullptr;
if (p.isUnpacking()) {
p | t1;
t = std::unique_ptr<T>(t1);
t.reset((T*)t1);
} else {
t1 = t.get();
t1 = (PUP::able*)t.get();
p | t1;
}
}
Expand Down

0 comments on commit 243d32d

Please sign in to comment.