matlab::data::Reference<TypedArray<T>>
Templated C++ class to get reference to TypedArray
Description
The Reference<TypedArray<T>>
class extends the APIs available to
a reference to an Array
. It derives from the
Reference<Array>
class and provides iterators and type-safe
indexing. Use to modify the elements of a container such as a struct or cell.
Reference<TypedArray<T>>
is not thread-safe - do not pass
references to TypedArray
objects between threads.
TypedArrayRef
is defined in TypedArrayRef.hpp
as:
template <typename T> using TypedArrayRef = Reference<TypedArray<T>>;
Class Details
Namespace: | matlab::data |
Base class: | Reference<Array> |
Include: | TypedArrayRef.hpp |
Constructor
Reference(const Reference<Array>& rhs)
Description
Create a Reference<TypedArray<T>>
object from a
Reference<Array>
object.
Parameters
|
Value to copy. |
Throws
|
Element of |
Iterators
Begin Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
|
Iterator to beginning of array, specified as
|
|
Iterator, specified as |
None
End Iterators
iterator end()
const_iterator end() const
const_iterator cend() const
|
Iterator to end of array, specified as
|
|
Iterator, specified as |
None
Indexing Operators
operator[]
ArrayElementTypedRef<arr_elem_type, std::is_const<T>::value> operator[](size_t idx)
ArrayElementTypedRef<arr_elem_type, true> operator[](size_t idx) const
Enables []
indexing on a reference to an
Array
. Indexing is 0-based.
|
First array index. |
|
Temporary object containing index specified. If type
|
|
Temporary object containing index specified. The return value allows the element of the array to be retrieved, but not modified. |
|
Field name is invalid for a struct. |
Other Operators
operator=
Reference<TypedArray<T>>& operator= (TypedArray<T> rhs)
Assign a TypedArray
to an element of the referenced
Array
. The Array
being indexed must be
non-const
.
|
Value to assign. |
|
Updated instance. |
None
Version History
Introduced in R2017b