Custom Query (147 matches)
Results (10 - 12 of 147)
Ticket |
---|
#6 |
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 |
#12 |
Description |
If I try to default-construct a struct with no elements using an empty initializer, the generated code inserts a zero into the initializer, making a warning -- GCC finishes silently on the same code: struct tag {}; int main() { struct tag t = {}; } Error: CFA Version 1.0.0 (debug) tag_struct.c: In function ‘__main__Fi___1’: tag_struct.c:5:33: warning: excess elements in struct initializer } ^ tag_struct.c:5:33: note: (near initialization for ‘__t__4stag_2’) |
#13 |
Description |
The current definition of vector contains two type parameters: trait allocator_c(otype T, otype allocator_t) { void realloc_storage(allocator_t*, size_t); T* data(allocator_t*); }; forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) struct vector; Instances of vector, awkwardly require specifying both type parameters: vector( int, heap_allocator(int) ) iv; Most of the time, the second parameter will be heap_allocator(T), so we want to allow specifying a default value for type parameters, e.g., forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t)) struct vector; |