Changeset fd54fef for tests/sum.cfa
- Timestamp:
- Jan 19, 2021, 8:44:29 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- dafbde8
- Parents:
- 2f47ea4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/sum.cfa
r2f47ea4 rfd54fef 18 18 #include <stdlib.hfa> 19 19 20 trait sumable( otypeT ) {20 trait sumable( T ) { 21 21 void ?{}( T &, zero_t ); // 0 literal constructor 22 22 T ?+?( T, T ); // assortment of additions … … 26 26 }; // sumable 27 27 28 forall( otypeT | sumable( T ) ) // use trait28 forall( T | sumable( T ) ) // use trait 29 29 T sum( size_t size, T a[] ) { 30 30 T total = 0; // initialize by 0 constructor … … 107 107 | sum( size, (S *)a ) | ", check" | (S)s; 108 108 109 forall( otypeImpl | sumable( Impl ) )109 forall( Impl | sumable( Impl ) ) 110 110 struct GS { 111 111 Impl * x, * y; … … 194 194 sum( size, (S *)a ).[i, j], s.[i, j] ); 195 195 196 forall( otypeImpl | sumable( Impl ) )196 forall( Impl | sumable( Impl ) ) 197 197 struct GS { 198 198 Impl * x, * y;
Note: See TracChangeset
for help on using the changeset viewer.