express: Fix compilation error with GCC

This commit is contained in:
rdb 2022-03-09 16:22:58 +01:00
parent 5475084717
commit 3d31f117e0

View File

@ -33,9 +33,7 @@ WeakPointerToBase(To *ptr) {
template<class T>
INLINE WeakPointerToBase<T>::
WeakPointerToBase(const PointerToBase<T> &copy) {
// This double-casting is a bit of a cheat to get around the inheritance
// issue--it's difficult to declare a template class to be a friend.
To *ptr = (To *)((const WeakPointerToBase<To> *)&copy)->_void_ptr;
To *ptr = (To *)copy._void_ptr;
_void_ptr = ptr;
if (ptr != nullptr) {
_weak_ref = ptr->weak_ref();