diff --git a/api/include/opentelemetry/nostd/shared_ptr.h b/api/include/opentelemetry/nostd/shared_ptr.h index 88eeb32ef7..7afc30f9be 100644 --- a/api/include/opentelemetry/nostd/shared_ptr.h +++ b/api/include/opentelemetry/nostd/shared_ptr.h @@ -57,8 +57,7 @@ class shared_ptr void MoveTo(typename shared_ptr::PlacementBuffer &buffer) noexcept { using other_shared_ptr_wrapper = typename shared_ptr::shared_ptr_wrapper; - new (buffer.data) - other_shared_ptr_wrapper{std::move(std::static_pointer_cast(this->ptr_))}; + new (buffer.data) other_shared_ptr_wrapper{std::move(this->ptr_)}; } virtual pointer Get() const noexcept { return ptr_.get(); }