diff options
Diffstat (limited to 'arm_compute/core/Dimensions.h')
-rw-r--r-- | arm_compute/core/Dimensions.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arm_compute/core/Dimensions.h b/arm_compute/core/Dimensions.h index 912b9d57d7..ae8d6c3503 100644 --- a/arm_compute/core/Dimensions.h +++ b/arm_compute/core/Dimensions.h @@ -100,7 +100,20 @@ public: * * @return The size of the requested dimension. */ - T operator[](size_t dimension) const + const T &operator[](size_t dimension) const + { + ARM_COMPUTE_ERROR_ON(dimension >= num_max_dimensions); + return _id[dimension]; + } + /** Generic accessor to get the size of any dimension + * + * @note Precondition: dimension < Dimensions::num_max_dimensions + * + * @param[in] dimension Dimension of the wanted size + * + * @return The size of the requested dimension. + */ + T &operator[](size_t dimension) { ARM_COMPUTE_ERROR_ON(dimension >= num_max_dimensions); return _id[dimension]; |