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 ea3eb06 was
ea3eb06,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
formatting changes
|
-
Property mode set to
100644
|
File size:
293 bytes
|
Rev | Line | |
---|
[a0d9f94] | 1 | extern "C" { |
---|
| 2 | #include <stdio.h> |
---|
| 3 | } |
---|
| 4 | |
---|
| 5 | forall( type T | { T ?*?( T, T ); } ) |
---|
| 6 | T square( T t ) { |
---|
| 7 | return t * t; |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | forall( type U | { U square( U ); } ) |
---|
| 11 | U quad( U u ) { |
---|
| 12 | return square( square( u ) ); |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | int main() { |
---|
| 16 | int N = 2; |
---|
| 17 | printf( "result of quad of %d is %d\n", N, quad( N ) ); |
---|
| 18 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.