[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN/internal vector.hh
From: |
Edward Rosten |
Subject: |
[Toon-members] TooN/internal vector.hh |
Date: |
Fri, 09 Jan 2009 15:21:49 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 09/01/09 15:21:49
Modified files:
internal : vector.hh
Log message:
Added some more bounds checking/slice checking
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vector.hh?cvsroot=toon&r1=1.3&r2=1.4
Patches:
Index: vector.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vector.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- vector.hh 9 Jan 2009 15:11:50 -0000 1.3
+++ vector.hh 9 Jan 2009 15:21:49 -0000 1.4
@@ -116,15 +116,18 @@
static int stride(){return 1;}
Precision& operator[](int i){
+ Internal::check_index(Size, i);
return my_data[i];
}
const Precision& operator[](int i) const {
+ Internal::check_index(Size, i);
return my_data[i];
}
template <int Start, int Length>
Vector<Length, Precision, SVBase<Length,1, Precision> >
slice(){
+ Internal::CheckSlice<Size, Start, Length>::check();
return Vector<Length, Precision, SVBase<Length,1,Precision>
>(&(my_data[Start]));
}