Changes in / [bbc9b64:a357b4c]
- File:
-
- 1 edited
-
doc/generic_types/generic_types.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/generic_types.tex
rbbc9b64 ra357b4c 222 222 Hence, programmers can easily form new local environments to maximize reuse of existing functions and types. 223 223 224 Finally, \CFA allows variable overloading:224 Finally, variables may be overloaded: 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.