! \return The last element of the array */
| 410 | |
| 411 | /*! \return The last element of the array */ |
| 412 | T back() const { |
| 413 | ArrayObj* p = GetArrayObj(); |
| 414 | if (p == nullptr) { |
| 415 | TVM_FFI_THROW(IndexError) << "cannot index a null array"; |
| 416 | } |
| 417 | return details::AnyUnsafe::CopyFromAnyViewAfterCheck<T>(p->back()); |
| 418 | } |
| 419 | |
| 420 | public: |
| 421 | // mutation in std::vector, implements copy-on-write |
nothing calls this directly
no outgoing calls
no test coverage detected