Skip to content

Latest commit

 

History

History
118 lines (73 loc) · 3.29 KB

platform-arrayreference-class.md

File metadata and controls

118 lines (73 loc) · 3.29 KB
descriptiontitlems.datems.topicf1_keywordshelpviewer_keywordsms.assetid
Learn more about: Platform::ArrayReference Class
Platform::ArrayReference Class
10/16/2019
reference
VCCORLIB/Platform::ArrayReference::ArrayReference
Platform::ArrayReference Class
9ab3b15e-8a60-4600-8fcb-7d6c86284f4b

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::ArrayReferenceInitializes 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: Windows 8

Minimum supported server: Windows Server 2012

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 is a standard C++ class template, and Platform::Array is a ref class.

See also

Platform namespace

close