Opened 6 years ago

Closed 6 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:


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 
  Address of:
      Untyped Member Expression, with field: 
        Name: data
        from aggregate: 
          Applying untyped: 
            Name: *?
            Name: this

Change History (2)

comment:1 Changed 6 years ago by ajbeach

Priority: majorminor

comment:2 Changed 6 years ago by Rob Schluntz

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