Changes in src/examples/sum.c [4040425:b63e376]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/sum.c
r4040425 rb63e376 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 18:12:01201613 // Update Count : 19 412 // Last Modified On : Fri Mar 4 15:06:47 2016 13 // Update Count : 196 14 14 // 15 15 16 16 #include <fstream> 17 17 18 trait sumable( type T ) {18 trait sumable( otype T ) { 19 19 const T 0; 20 20 T ?+?( T, T ); … … 24 24 }; // sumable 25 25 26 forall( type T | sumable( T ) )26 forall( otype T | sumable( T ) ) 27 27 T sum( unsigned int n, T a[] ) { 28 28 T total = 0; // instantiate T, select 0
Note: See TracChangeset
for help on using the changeset viewer.