diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-06-01 07:56:24 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-06-01 07:56:24 +0000 |
commit | 6d749c172a2f8f4dd5ec342356553f0b70018f74 (patch) | |
tree | 381948895c40256b7283b98eda55913a3352cfe2 /tvmet-1.7.1/include/tvmet/xpr/Vector.h | |
parent | 887ff84376ffb5aae81bdf56cb27fca6ffd606eb (diff) |
replace size_t with int everywhere.
The size_t type means a number of _bytes_, and it was misused as
counting e.g. the number of rows/columns in a matrix. Moreover, it is unsigned,
which can give strange bugs if a signed/unsigned mismatch occurs.
Diffstat (limited to 'tvmet-1.7.1/include/tvmet/xpr/Vector.h')
-rw-r--r-- | tvmet-1.7.1/include/tvmet/xpr/Vector.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tvmet-1.7.1/include/tvmet/xpr/Vector.h b/tvmet-1.7.1/include/tvmet/xpr/Vector.h index b3c2e9a2d..6416c648a 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Vector.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Vector.h @@ -31,7 +31,7 @@ namespace tvmet { /* forwards */ -template <class T, std::size_t Sz> class Vector; +template <class T, int Sz> class Vector; /** * \class XprVector Vector.h "tvmet/xpr/Vector.h" @@ -46,7 +46,7 @@ template <class T, std::size_t Sz> class Vector; * actually implements the expression. * \note leave the Ctors non-explicit to allow implicit type conversation. */ -template<class E, std::size_t Sz> +template<class E, int Sz> class XprVector : public TvmetBase< XprVector<E, Sz> > { XprVector(); @@ -83,13 +83,13 @@ public: #endif /** const index operator for vectors. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { TVMET_RT_CONDITION(i < Size, "XprVector Bounce Violation") return m_expr(i); } /** const index operator for vectors. */ - value_type operator[](std::size_t i) const { + value_type operator[](int i) const { return this->operator()(i); } @@ -118,7 +118,7 @@ public: } public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, std::size_t l=0) const { + void print_xpr(std::ostream& os, int l=0) const { os << IndentLevel(l++) << "XprVector[" << (use_meta ? "M" : "L") << ", O=" << ops << "]<" |