mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add support for C++23 multidimensional subscript operator
I'm not sure where to put tests for this, assuming they're needed. They also wouldn't run in CI anyway since CI only exercises the C++17 codepaths. See merge request libeigen/eigen!2053
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
b6fcddccfc
commit
f95b4698fc
@@ -365,6 +365,15 @@ class Transform {
|
||||
* \sa MatrixBase::operator(Index,Index) */
|
||||
EIGEN_DEVICE_FUNC inline Scalar& operator()(Index row, Index col) { return m_matrix(row, col); }
|
||||
|
||||
#if __cpp_multidimensional_subscript >= 202110L
|
||||
/** shortcut for m_matrix(row,col);
|
||||
* \sa MatrixBase::operator(Index,Index) const */
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator[](Index row, Index col) const { return m_matrix[row, col]; }
|
||||
/** shortcut for m_matrix(row,col);
|
||||
* \sa MatrixBase::operator(Index,Index) */
|
||||
EIGEN_DEVICE_FUNC inline Scalar& operator[](Index row, Index col) { return m_matrix[row, col]; }
|
||||
#endif
|
||||
|
||||
/** \returns a read-only expression of the transformation matrix */
|
||||
EIGEN_DEVICE_FUNC inline const MatrixType& matrix() const { return m_matrix; }
|
||||
/** \returns a writable expression of the transformation matrix */
|
||||
|
||||
Reference in New Issue
Block a user