Skip to content
Snippets Groups Projects
Commit f0807b88 authored by Christian Engwer's avatar Christian Engwer
Browse files

v.size() returns size_t not int

[[Imported from SVN: r1624]]
parent c8b43334
No related branches found
No related tags found
No related merge requests found
......@@ -22,26 +22,26 @@ namespace Dune {
//! Constructor which initializes the field
BitField(int n, bool v) : std::vector<bool>(n) {
for (int i=0; i<size(); i++)
for (size_t i=0; i<size(); i++)
(*this)[i] = v;
}
//! Sets all entries to <tt> true </tt>
void setAll() {
for (int i=0; i<size(); i++)
for (size_t i=0; i<size(); i++)
(*this)[i] = true;
}
//! Sets all entries to <tt> false </tt>
void unsetAll() {
for (int i=0; i<size(); i++)
for (size_t i=0; i<size(); i++)
(*this)[i] = false;
}
//! Returns the number of set bits
int nSetBits() const {
int n = 0;
for (int i=0; i<size(); i++)
for (size_t i=0; i<size(); i++)
n += ((*this)[i]) ? 1 : 0;
return n;
......@@ -50,7 +50,7 @@ namespace Dune {
//! Send bitfield to an output stream
friend std::ostream& operator<< (std::ostream& s, const BitField& v)
{
for (int i=0; i<v.size(); i++)
for (size_t i=0; i<v.size(); i++)
s << v[i] << " ";
s << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment