Opened 4 years ago

Closed 4 years ago

#6 closed defect (fixed)

Vector as Field of Generic Type Fails to Compile

Reported by: ajbeach Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

I tried to make a generic container (a stack) that used a vector as a base. However it would not compile, even when I stripped it down to the most simple member function.

forall(otype T)
struct stack {
    vector(T, heap_allocator(T)) data;
};

bool empty(stack(int) * this) {
    return empty(&this->data);
}

Error message I received:

CFA Version 1.0.0 (debug)
implicit-handlers.c:45 error: No reasonable alternatives for expression Applying untyped: 
  Name: empty
...to: 
  Address of:
      Untyped Member Expression, with field: 
        Name: data
        from aggregate: 
          Applying untyped: 
            Name: *?
          ...to: 
            Name: this

Change History (2)

comment:1 Changed 4 years ago by ajbeach

Priority: majorminor

comment:2 Changed 4 years ago by Rob Schluntz

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.