diff --git a/std_lib_facilities.h b/std_lib_facilities.h index 2fd388c..4023046 100644 --- a/std_lib_facilities.h +++ b/std_lib_facilities.h @@ -84,12 +84,12 @@ template< class T> struct Vector : public std::vector { T& operator[](unsigned int i) // rather than return at(i); { - if (i<0||this->size()<=i) throw Range_error(i); + if (this->size()<=i) throw Range_error(i); return std::vector::operator[](i); } const T& operator[](unsigned int i) const { - if (i<0||this->size()<=i) throw Range_error(i); + if (this->size()<=i) throw Range_error(i); return std::vector::operator[](i); } }; @@ -104,13 +104,13 @@ struct String : std::string { char& operator[](unsigned int i) // rather than return at(i); { - if (i<0||size()<=i) throw Range_error(i); + if (size()<=i) throw Range_error(i); return std::string::operator[](i); } const char& operator[](unsigned int i) const { - if (i<0||size()<=i) throw Range_error(i); + if (size()<=i) throw Range_error(i); return std::string::operator[](i); } };