forked from OctaForge/libostd
mark explicit
parent
16c1cc203e
commit
f70d8e792d
|
@ -22,17 +22,17 @@ namespace octa {
|
||||||
|
|
||||||
explicit Vector(): p_buf(NULL), p_len(0), p_cap(0) {}
|
explicit Vector(): p_buf(NULL), p_len(0), p_cap(0) {}
|
||||||
|
|
||||||
Vector(const Vector &v): p_buf(NULL), p_len(0), p_cap(0) {
|
explicit Vector(size_t n, const T &val = T()): Vector() {
|
||||||
*this = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector(size_t n, const T &val = T()): Vector() {
|
|
||||||
p_buf = new uchar[n * sizeof(T)];
|
p_buf = new uchar[n * sizeof(T)];
|
||||||
p_len = p_cap = n;
|
p_len = p_cap = n;
|
||||||
T *cur = p_buf, *last = p_buf + n;
|
T *cur = p_buf, *last = p_buf + n;
|
||||||
while (cur != last) new (cur++) T(val);
|
while (cur != last) new (cur++) T(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector(const Vector &v): p_buf(NULL), p_len(0), p_cap(0) {
|
||||||
|
*this = v;
|
||||||
|
}
|
||||||
|
|
||||||
~Vector() {
|
~Vector() {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue