source: translator/examples/twice.c @ 17cd4eb

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 17cd4eb was 42dcae7, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

re-inserted remove and reorder hoisted aggregate, fixed example programs

  • Property mode set to 100644
File size: 351 bytes
Line 
1#include "fstream.h"
2
3forall( type T | { T ?+?( T, T ); T ?++( T * ); [T] ?+=?( T *, T ); } )
4T twice( const T t ) {
5    return t + t;
6}
7
8int main() {
9    ofstream *sout = ofstream_stdout();
10    sout << twice( 1 ) << ' ' << twice( 3.2 ) << '\n';
11}
12
13// Local Variables: //
14// compile-command: "../../bin/cfa twice.c fstream.o iostream.o" //
15// End: //
Note: See TracBrowser for help on using the repository browser.