You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to access an element of an iDynTree vector the operator() has to be used. Having the operator[] may be useful when template functions are implemented. I.e. std:: vector<> uses the operator[] to provide the access to the elements.
I noticed that this strategy is already implemented in Eigen (check here for further details)
The text was updated successfully, but these errors were encountered:
I totally agree. I think the original rationale for using operator() was to provide a consistent API with Matlab and Python (or perhaps it was Lua), in which the operator[] could not be overloaded. However, I do not think it is a problem to overload both operator() and operator[].
In order to access an element of an iDynTree vector the
operator()
has to be used. Having theoperator[]
may be useful when template functions are implemented. I.e.std:: vector<>
uses theoperator[]
to provide the access to the elements.I noticed that this strategy is already implemented in
Eigen
(check here for further details)The text was updated successfully, but these errors were encountered: