aboutsummaryrefslogtreecommitdiffhomepage
path: root/tvmet-1.7.1/include/tvmet/xpr/Identity.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-06-01 07:56:24 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-06-01 07:56:24 +0000
commit6d749c172a2f8f4dd5ec342356553f0b70018f74 (patch)
tree381948895c40256b7283b98eda55913a3352cfe2 /tvmet-1.7.1/include/tvmet/xpr/Identity.h
parent887ff84376ffb5aae81bdf56cb27fca6ffd606eb (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/Identity.h')
-rw-r--r--tvmet-1.7.1/include/tvmet/xpr/Identity.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/tvmet-1.7.1/include/tvmet/xpr/Identity.h b/tvmet-1.7.1/include/tvmet/xpr/Identity.h
index 3e7113f1e..7b13fa6b6 100644
--- a/tvmet-1.7.1/include/tvmet/xpr/Identity.h
+++ b/tvmet-1.7.1/include/tvmet/xpr/Identity.h
@@ -20,7 +20,7 @@ namespace tvmet {
* \since release 1.6.0
* \sa identity
*/
-template<class T, std::size_t Rows, std::size_t Cols>
+template<class T, int Rows, int Cols>
struct XprIdentity
: public TvmetBase< XprIdentity<T, Rows, Cols> >
{
@@ -38,12 +38,12 @@ public:
public:
/** access by index. */
- value_type operator()(std::size_t i, std::size_t j) const {
+ value_type operator()(int i, int j) const {
return i==j ? 1 : 0;
}
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++)
<< "XprIdentity[O="<< ops << ")]<"
<< std::endl;