Aracılığıyla paylaş


auto_ptr::operator =

Sahiplik birinden aktaran bir atama işleci auto_ptr başka bir nesne.

template<class Other>
   auto_ptr<Type>& operator=(
      auto_ptr<Other>& _Right
   ) throw( );
auto_ptr<Type>& operator=(
   auto_ptr<Type>& _Right
) throw( );
auto_ptr<Type>& operator=(
   auto_ptr_ref<Type> _Right
) throw( );

Parametreler

  • _Right
    Bir nesne türü auto_ptr.

Dönüş Değeri

Türünde bir nesne için bir başvuru auto_ptr<türü>.

Notlar

Atama deyimi değerlendirir myptr silmek, ancak yalnızca saklı işaretçi myptr değişiklikler nedeniyle atama. Sonra _ içinde saklanan işaretçi sahipliğini aktarırsağ, depolayarak _sağ.release in myptr. İşlev verir * Bu.

Örnek

Üye işleci kullanımı örneği için bkz: auto_ptr::auto_ptr.

Gereksinimler

Başlık: <memory>

Namespace: std

Ayrıca bkz.

Başvuru

auto_ptr Class