0001 /****************************************************************************************** 0002 * Data Structures in C++ 0003 * ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3 0004 * Junhui DENG, deng@tsinghua.edu.cn 0005 * Computer Science & Technology, Tsinghua University 0006 * Copyright (c) 2003-2019. All rights reserved. 0007 ******************************************************************************************/ 0008 0009 template <typename T> T & Vector<T>::operator[] ( Rank r ) //重载下标操作符 0010 { return _elem[r]; } // assert: 0 <= r < _size 0011 0012 template <typename T> const T & Vector<T>::operator[] ( Rank r ) const //仅限于做右值 0013 { return _elem[r]; } // assert: 0 <= r < _size