aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-25 11:04:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-25 11:04:31 +0200
commit7d75dc6b474c33c8b20407aa37a33932cbf35620 (patch)
tree25ddf90b8de1f585a4499d2df36cd83599b0c184
parent956d26d4620797d3b5c725e4f51b52810ff375ef (diff)
Add required argument to std::out_of_range
-rw-r--r--butl/vector-view9
1 files changed, 7 insertions, 2 deletions
diff --git a/butl/vector-view b/butl/vector-view
index fdff783..16cb1d1 100644
--- a/butl/vector-view
+++ b/butl/vector-view
@@ -81,11 +81,16 @@ namespace butl
// element access:
//
reference operator[](size_type n) const {return data_[n];}
- reference at(size_type n) const {
- if (n >= size_) throw std::out_of_range (); return data_[n];}
reference front() const {return data_[0];}
reference back() const {return data_[size_ - 1];}
+ reference at(size_type n) const
+ {
+ if (n >= size_)
+ throw std::out_of_range ("index out of range");
+ return data_[n];
+ }
+
// data access:
//
T* data() const {return data_;}