Opened 7 years ago

Closed 7 years ago

#18 closed enhancement (fixed)

Allow sizeof On Generic Type Parameters

Reported by: ajbeach Owned by: Aaron Moss <a3moss@…>
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

I just found a note in one of the tests about a feature request. Short version is sizeof(T) does not compile. Here is the example I found.

forall(otype T)
union ByteView {
    T val;
    char bytes[(sizeof(int))]; // want to change to sizeof(T)
};

I did test it with sizeof(T) and it produced an error, but at the same time it feels like an operation that should be allowed. I think the value is already there, just not accessible directly.

Change History (1)

comment:1 Changed 7 years ago by Aaron Moss <a3moss@…>

Owner: set to Aaron Moss <a3moss@…>
Resolution: fixed
Status: newclosed

In fea3faa:

Strip bodies of generic structs pre-codegen [fixes #18]

Note: See TracTickets for help on using tickets.