Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/multiDimension.c

    r4e2a1137 r2afec66  
    44};
    55
    6 void ?{}(X * this) {
     6void ?{}(X & this) {
    77  printf("default constructing\n");
    8   (&this->a){ 123 };
    9   this->ptr = malloc(sizeof(int));
     8  (this.a){ 123 };
     9  this.ptr = malloc(sizeof(int));
    1010}
    1111
    12 void ?{}(X * this, X other) {
     12void ?{}(X & this, X other) {
    1313  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));
    1616}
    1717
    18 void ?{}(X * this, int a) {
     18void ?{}(X & this, int a) {
    1919  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));
    2222}
    2323
    24 void ^?{}(X * this) {
     24void ^?{}(X & this) {
    2525  printf("destructing\n");
    26   free(this->ptr);
     26  free(this.ptr);
    2727}
    2828
    29 X ?=?(X * this, X other) {
    30   this->a = other.a;
    31   return *this;
     29X ?=?(X & this, X other) {
     30  this.a = other.a;
     31  return this;
    3232}
    3333
Note: See TracChangeset for help on using the changeset viewer.