Changes in / [a357b4c:bbc9b64]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/generic_types.tex
ra357b4c rbbc9b64 222 222 Hence, programmers can easily form new local environments to maximize reuse of existing functions and types. 223 223 224 Finally, variables may be overloaded:224 Finally, \CFA allows variable overloading: 225 225 \lstDeleteShortInline@ 226 226 \par\smallskip … … 271 271 forall( otype T | summable( T ) ) 272 272 T sum( T a[$\,$], size_t size ) { 273 T total = { 0 };$\C{// instantiate T from 0}$273 `T` total = { `0` }; $\C{// instantiate T from 0}$ 274 274 for ( unsigned int i = 0; i < size; i += 1 ) 275 total += a[i];$\C{// select appropriate +}$275 total `+=` a[i]; $\C{// select appropriate +}$ 276 276 return total; 277 277 }
Note: See TracChangeset
for help on using the changeset viewer.