Main Content

matlab::data::Reference<Struct>

C++ class to get reference to element of StructArray

Description

Use the Reference<Struct> class to access an element of a StructArray.

Class Details

Namespace:

matlab::data

Include:

StructRef.hpp

Indexing Operators

operator[]

Reference<Array> operator[](std::string idx)

Array operator[](std::string idx) const

Description

Index into the Struct with a field name.

Parameters

std::string idx

Field name.

Returns

Reference<Array>

Reference to Array found at specified field.

Array

Shared copy of Array found at specified field.

Throws

matlab::data::InvalidFieldNameException

Field does not exist in the struct.

Iterators

Begin Iterators

iterator begin()

const_iterator begin() const

const_iterator cbegin() const

Returns

iterator

Iterator to beginning of list of fields, specified as TypedIterator<T>.

const_iterator

Iterator, specified as TypedIterator<typename std::add_const<T>::type>.

Throws

None

End Iterators

iterator end()

const_iterator end() const

const_iterator cend() const

Returns

iterator

Iterator to end of list of fields, specified as TypedIterator<T>.

const_iterator

Iterator, specified as TypedIterator<typename std::add_const<T>::type>.

Throws

None

Cast

Struct()

operator Struct() const

Returns

Struct

Shared copy of Struct.

Throws

None

Version History

Introduced in R2017b