matlab::data::Reference<T>
Templated C++ class to get references to Array
elements
Description
A Reference
object is a reference to an element of an
Array
without making a copy. A Reference
is:
Not a shared copy
Valid as long as the array that contains the reference is valid
Not thread-safe
Class Details
Namespace: | matlab::data |
Include: | Reference.hpp |
Template Parameters
|
Type of element referred to, specified as:
|
Constructors
Copy Constructor
Reference(const Reference<T>& rhs)
|
Value to copy. |
Copy Assignment Operators
Reference<T>& operator=(const Reference<T>& rhs)
|
Value to copy. |
|
Updated instance. |
Move Assignment Operators
Reference<T>& operator=(Reference<T>&&
rhs)
|
Value to move. |
|
Updated instance. |
None
Move Constructors
Reference(Reference<T>&& rhs)
Moves contents of a Reference
object to a new instance.
|
Value to move. |
None
Other Operators
operator=
Reference<T>& operator=(T rhs)
Reference<T>& operator=(std::string rhs)
Reference<T>& operator=(String rhs)
|
Value to assign. The indexed array must be
non- |
|
String to assign. The array must be
non- |
|
String to assign to |
|
Updated instance. |
None
operator<<
std::ostream& operator <<(std::ostream& os, Reference<T> const& rhs)
| |
|
|
operator T()
operator T() const
Cast to element from the array.
|
Shared copy of element from array. |
None
operator std::string()
operator std::string() const
Casts array to std::string
, making a copy of the
std::string
. This operator is valid only for types that
can be cast to a std::string
.
|
String. |
| Input is |
|
|
Free Functions
operator==
inline bool operator ==(Reference<MATLABString> const& lhs, std::string const& rhs)
inline bool operator ==(std::string const& lhs, Reference<MATLABString> const& rhs)
inline bool operator ==(Reference<MATLABString> const& lhs, String const& rhs)
inline bool operator ==(String const& lhs, Reference<MATLABString> const& rhs)
inline bool operator ==(Reference<MATLABString> const& lhs, MATLABString const& rhs)
inline bool operator ==(MATLABString const& lhs, Reference<MATLABString> const& rhs)
inline bool operator ==(Reference<MATLABString> const& lhs, Reference<MATLABString> const& rhs)
template<typename T>
bool operator ==(Reference<T> const& lhs, T const& rhs)
template<typename T>
bool operator ==(T const& lhs, Reference<T> const& rhs)
template<typename T>
bool operator ==(Reference<T> const& lhs, Reference<T> const& rhs)
|
|
Values to compare. |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
Returns |
|
Cannot compare argument to
|
Version History
Introduced in R2017b