Commit 8077e6bd authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Update MaxId in set method.

parent 7393bcc1
......@@ -46,7 +46,8 @@ public:
void operator+=(const char i) {this->InsertNextValue(i);};
// operator[] can be used on both left and right side of expression;
// Note: if used on lh side, user's responsibility to do range checking
char& operator[](const int i) {return this->Array[i];};
char& operator[](const int i)
{if (i > this->MaxId) this->MaxId = i; return this->Array[i];};
void Squeeze() {this->Resize (this->MaxId+1);};
int GetSize() {return this->Size;};
int GetMaxId() {return this->MaxId;};
......
......@@ -44,7 +44,8 @@ public:
void operator+=(const float f) {this->InsertNextValue(f);};
// operator[] can be used on both left and right side of expression;
// Note: if used on lh side, user's responsibility to do range checking
float& operator[](const int i) {return this->Array[i];};
float& operator[](const int i)
{if (i > this->MaxId) this->MaxId = i; return this->Array[i];};
void Squeeze() {this->Resize (this->MaxId+1);};
int GetSize() {return this->Size;};
int GetMaxId() {return this->MaxId;};
......
......@@ -44,7 +44,8 @@ public:
void operator+=(const int i) {this->InsertNextValue(i);};
// operator[] can be used on both left and right side of expression;
// Note: if used on lh side, user's responsibility to do range checking
int& operator[](const int i) {return this->Array[i];};
int& operator[](const int i)
{if (i > this->MaxId) this->MaxId = i; return this->Array[i];};
void Squeeze() {this->Resize (this->MaxId+1);};
int GetSize() {return this->Size;};
int GetMaxId() {return this->MaxId;};
......
......@@ -46,7 +46,8 @@ public:
void operator+=(const short i) {this->InsertNextValue(i);};
// operator[] can be used on both left and right side of expression;
// Note: if used on lh side, user's responsibility to do range checking
short& operator[](const int i) {return this->Array[i];};
short& operator[](const int i)
{if (i > this->MaxId) this->MaxId = i; return this->Array[i];};
void Squeeze() {this->Resize (this->MaxId+1);};
int GetSize() {return this->Size;};
int GetMaxId() {return this->MaxId;};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment