ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change
on this file since 09d1ad0 was
68cd1ce,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
unify and fix storage class
|
-
Property mode set to
100644
|
File size:
906 bytes
|
Rev | Line | |
---|
[b1d6dd5] | 1 | context addable( type T ) { |
---|
| 2 | T ?+?( T,T ); |
---|
| 3 | T ?=?( T*, T); |
---|
| 4 | }; |
---|
| 5 | |
---|
| 6 | type List1( type T | addable( T ) ) = struct { T data; List1( T ) *next; } *; |
---|
| 7 | typedef List1( int ) ListOfIntegers; |
---|
| 8 | //List1( int ) li; |
---|
| 9 | ListOfIntegers li; |
---|
| 10 | int f( List1( int ) ( (*g ))( int ) ); |
---|
| 11 | [int] h( * List1( int ) p ); // new declaration syntax |
---|
| 12 | |
---|
[68cd1ce] | 13 | struct( type T ) S2 { T i; }; // actual definition |
---|
| 14 | struct( int ) S3 v1, *p; // expansion and instantiation |
---|
| 15 | struct( type T )( int ) S24 { T i; } v2; // actual definition, expansion and instantiation |
---|
[b1d6dd5] | 16 | struct( type T )( int ) { T i; } v2; // anonymous actual definition, expansion and instantiation |
---|
| 17 | |
---|
| 18 | struct( type T | addable( T ) ) node { T data; struct( T ) node *next; }; |
---|
| 19 | type List( type T ) = struct( T ) node *; |
---|
| 20 | List( int ) my_list; |
---|
| 21 | |
---|
| 22 | type Complex | addable( Complex ); |
---|
| 23 | |
---|
| 24 | int main() { |
---|
| 25 | (struct( int ) node)my_list; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | // Local Variables: // |
---|
| 29 | // tab-width: 4 // |
---|
| 30 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.