Changes in src/tests/multiDimension.c [4e2a1137:2afec66]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/multiDimension.c
r4e2a1137 r2afec66 4 4 }; 5 5 6 void ?{}(X *this) {6 void ?{}(X & this) { 7 7 printf("default constructing\n"); 8 ( &this->a){ 123 };9 this ->ptr = malloc(sizeof(int));8 (this.a){ 123 }; 9 this.ptr = malloc(sizeof(int)); 10 10 } 11 11 12 void ?{}(X *this, X other) {12 void ?{}(X & this, X other) { 13 13 printf("copy constructing\n"); 14 ( &this->a){ other.a };15 this ->ptr = malloc(sizeof(int));14 (this.a){ other.a }; 15 this.ptr = malloc(sizeof(int)); 16 16 } 17 17 18 void ?{}(X *this, int a) {18 void ?{}(X & this, int a) { 19 19 printf("constructing with %d\n", a); 20 ( &this->a){ a };21 this ->ptr = malloc(sizeof(int));20 (this.a){ a }; 21 this.ptr = malloc(sizeof(int)); 22 22 } 23 23 24 void ^?{}(X *this) {24 void ^?{}(X & this) { 25 25 printf("destructing\n"); 26 free(this ->ptr);26 free(this.ptr); 27 27 } 28 28 29 X ?=?(X *this, X other) {30 this ->a = other.a;31 return *this;29 X ?=?(X & this, X other) { 30 this.a = other.a; 31 return this; 32 32 } 33 33
Note:
See TracChangeset
for help on using the changeset viewer.