set data to NULL by default
This commit is contained in:
parent
76a1ddd26a
commit
388a52eca1
8
main.cpp
8
main.cpp
@ -17,9 +17,11 @@ struct myPair {
|
||||
T1 first;
|
||||
T2 second;
|
||||
|
||||
myPair() : first(), second() {}
|
||||
myPair() : first(), second() {
|
||||
}
|
||||
|
||||
myPair(const T1 &first, const T2 &second) : first(first), second(second) {}
|
||||
myPair(const T1 &first, const T2 &second) : first(first), second(second) {
|
||||
}
|
||||
};
|
||||
|
||||
// -------- END PAIR IMPL --------
|
||||
@ -60,6 +62,7 @@ string toString(int x) {
|
||||
int max(int a, int b) {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
// -------- END HELPER FUNCTIONS --------
|
||||
|
||||
// -------- START RAII HELPERS--------
|
||||
@ -111,6 +114,7 @@ public:
|
||||
myVec() {
|
||||
capacity = 0;
|
||||
length = 0;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
myVec(size_t size) {
|
||||
|
Loading…
Reference in New Issue
Block a user