Skip to content

Latest commit

 

History

History
131 lines (86 loc) · 3.74 KB

platform-arrayreference-class.md

File metadata and controls

131 lines (86 loc) · 3.74 KB
titlems.customms.datems.prodms.technologyms.reviewerms.suitems.tgt_pltfrmms.topicf1_keywordsdev_langshelpviewer_keywordsms.assetidcaps.latest.revisionauthorms.authormanager
Platform::ArrayReference Class | Microsoft Docs
12/30/2016
windows-client-threshold
language-reference
Platform/Platform::ArrayReference
C++
Platform::ArrayReference Class
9ab3b15e-8a60-4600-8fcb-7d6c86284f4b
4
ghogen
ghogen
ghogen

Platform::ArrayReference Class

ArrayReference is an optimization type that you can substitute for Platform::Array^ in input parameters when you want to fill a C-style array with the input data.

Syntax

classArrayReference

Members

Public Constructors

NameDescription
ArrayReference::ArrayReference ConstructorInitializes a new instance of the ArrayReference class.

Public Operators

NameDescription
ArrayReference::operator() OperatorConverts this ArrayReference to a Platform::Array<T>^*.
ArrayReference::operator= OperatorAssigns the contents of another ArrayReference to this instance.

Exceptions

Remarks

By using ArrayReference to fill a C-style array, you avoid the extra copy operation that would be involved in copying first to a Platform::Array variable, and then into the C-style array. When you use ArrayReference, there is only one copy operation. For a code example, see Array and WriteOnlyArray.

Requirements

Minimum supported client: [!INCLUDEwin8]

Minimum supported server: [!INCLUDEwinserver8]

Namespace: Platform

Header: vccorlib.h

ArrayReference::ArrayReference Constructor

Initializes a new instance of the Platform::ArrayReference class.

Syntax

ArrayReference(TArg* ataArg, unsignedint sizeArg, bool needsInitArg = false); ArrayReference(ArrayReference&& otherArg) 

Parameters

dataArg
A pointer to the array data.

sizeArg
The number of elements in the source array.

otherArg
An ArrayReference object whose data will be moved to initialize the new instance.

Remarks

ArrayReference::operator= Operator

Assigns the specified object to the current Platform::ArrayReference object by using move semantics.

Syntax

 ArrayReference& operator=(ArrayReference&& otherArg); 

Parameters

otherArg
The object that is moved to the current ArrayReference object.

Return Value

A reference to an object of type ArrayReference.

Remarks

Platform::ArrayReference is a standard C++ class template, not a ref class.

ArrayReference::operator() Operator

Converts the current Platform::ArrayReference object back to a Platform::Array class.

Syntax

 Array<TArg>^ operator (); 

Return Value

A handle-to-object of type Array<TArg>^

Remarks

Platform::ArrayReference and Platform::Array are standard C++ class templates, not ref classes.

See Also

Platform namespace

close