Changes in tests/polymorphism.cfa [fd54fef:f498c51]
- File:
-
- 1 edited
-
tests/polymorphism.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/polymorphism.cfa
rfd54fef rf498c51 18 18 #include <fstream.hfa> 19 19 20 forall( T)20 forall(otype T) 21 21 T f(T x, T y) { 22 22 x = y; … … 24 24 } 25 25 26 forall( T) T ident(T x) {26 forall(otype T) T ident(T x) { 27 27 return x; 28 28 } 29 29 30 forall( T,U )30 forall( otype T, otype U ) 31 31 size_t struct_size( T i, U j ) { 32 32 struct S { T i; U j; }; … … 34 34 } 35 35 36 forall( T,U )36 forall( otype T, otype U ) 37 37 size_t union_size( T i, U j ) { 38 38 union B { T i; U j; }; … … 41 41 42 42 // perform some simple operations on aggregates of T and U 43 forall( T | { void print(T); int ?==?(T, T); },U | { void print(U); U ?=?(U&, zero_t); } )43 forall( otype T | { void print(T); int ?==?(T, T); }, otype U | { void print(U); U ?=?(U&, zero_t); } ) 44 44 U foo(T i, U j) { 45 45 struct S { T i; U j; };
Note:
See TracChangeset
for help on using the changeset viewer.