Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 1.53 KB

File metadata and controls

75 lines (60 loc) · 1.53 KB
title auto_handle::operator-> | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
f1_keywords
msclr::auto_handle::operator->
auto_handle.operator->
auto_handle::operator->
msclr.auto_handle.operator->
dev_langs
C++
helpviewer_keywords
auto_handle::operator->
ms.assetid c8c7a771-ea15-41fa-981a-065b8d1162b4
caps.latest.revision 10
author mikeblome
ms.author mblome
manager ghogen

auto_handle::operator->

The member access operator.

Syntax

_element_type ^ operator->();  

Return Value

The object that is wrapped by auto_handle.

Example

// msl_auto_handle_op_arrow.cpp  
// compile with: /clr  
#include <msclr\auto_handle.h>  
  
using namespace System;  
using namespace msclr;  
  
ref class ClassA {  
protected:     
   String^ m_s;  
public:  
   ClassA( String^ s ) : m_s( s ) {}  
  
   virtual void PrintHello() {  
      Console::WriteLine( "Hello from {0} A!", m_s );  
   }  
  
   int m_i;  
};  
  
int main() {  
   auto_handle<ClassA> a( gcnew ClassA( "first" ) );  
   a->PrintHello();  
  
   a->m_i = 5;  
   Console::WriteLine( "a->m_i = {0}", a->m_i );  
}  
Hello from first A!  
a->m_i = 5  

Requirements

Header file <msclr\auto_handle.h>

Namespace msclr

See Also

auto_handle Members
auto_handle::get