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 51b7345 was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
initial commit
|
-
Property mode set to
100644
|
File size:
307 bytes
|
Line | |
---|
1 | // './cfa square.c' |
---|
2 | |
---|
3 | context has_star( type T ) |
---|
4 | { |
---|
5 | T ?*?( T, T ); |
---|
6 | }; |
---|
7 | |
---|
8 | int ?*?( int, int ); |
---|
9 | extern "C" { void printf( const char *, ... ); } |
---|
10 | int ?=?( int*, int ); |
---|
11 | |
---|
12 | forall( type T | has_star( T ) ) |
---|
13 | T |
---|
14 | square( T t ) |
---|
15 | { |
---|
16 | return t * t; |
---|
17 | } |
---|
18 | |
---|
19 | int |
---|
20 | main() |
---|
21 | { |
---|
22 | printf( "result of square of 5 is %d\n", square( 5 ) ); |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.