// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // twice.c -- // // Author : Richard C. Bilson // Created On : Wed May 27 17:56:53 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Wed May 27 18:37:23 2015 // Update Count : 1 // #include "fstream.h" forall( type T | { T ?+?( T, T ); T ?++( T * ); [T] ?+=?( T *, T ); } ) T twice( const T t ) { return t + t; } int main() { ofstream *sout = ofstream_stdout(); sout << twice( 1 ) << ' ' << twice( 3.2 ) << '\n'; } // Local Variables: // // tab-width: 4 // // compile-command: "cfa twice.c fstream.o iostream.o" // // End: //