Changeset 28e58fd for src/tests/multiDimension.c
- Timestamp:
- Aug 25, 2017, 10:38:34 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 800d275
- Parents:
- af08051 (diff), 3eab308c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/multiDimension.c
raf08051 r28e58fd 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.