Changeset b3f9a0cb for src/examples/sum.c
- Timestamp:
- Apr 4, 2016, 1:18:17 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- afc1045
- Parents:
- 89173242 (diff), 3cfe27f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/sum.c
r89173242 rb3f9a0cb 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.