| 455 | template <class T, class M> |
| 456 | template <class S, class M2> |
| 457 | void Persistent<T, M>::Copy(const Persistent<S, M2>& that) { |
| 458 | static_assert(std::is_base_of<T, S>::value, "type check"); |
| 459 | this->Reset(); |
| 460 | if (that.IsEmpty()) return; |
| 461 | internal::Address* p = reinterpret_cast<internal::Address*>(that.val_); |
| 462 | this->val_ = reinterpret_cast<T*>(api_internal::CopyGlobalReference(p)); |
| 463 | M::Copy(that, this); |
| 464 | } |
| 465 | |
| 466 | template <class T> |
| 467 | bool PersistentBase<T>::IsWeak() const { |