From b30d3257ec49260f0a646ea44d7e59b3729b72e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Thu, 16 Oct 2014 17:15:50 +0800 Subject: [PATCH] bug fix --- TinySTL/Vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TinySTL/Vector.h b/TinySTL/Vector.h index cc9d4ca..66bee2f 100644 --- a/TinySTL/Vector.h +++ b/TinySTL/Vector.h @@ -77,7 +77,7 @@ namespace TinySTL{ //访问元素相关 value_type& operator[](const difference_type i){ return *(begin() + i); } value_type& front(){ return *(begin()); } - value_type& back(){ return *(--end()); } + value_type& back(){ return *(end() - 1); } pointer data(){ return start_; } //修改容器相关的操作