Changeset 1ad1c99e for src/examples/array.c
- Timestamp:
- Apr 27, 2016, 5:35:59 PM (8 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, with_gc
- Children:
- 84bb4d9
- Parents:
- 21ae786
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/array.c
r21ae786 r1ad1c99e 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // array.c -- 7 // array.c -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Wed May 27 17:56:53 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Mar 2 18:13:52 201611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Apr 27 17:21:52 2016 13 13 // Update Count : 3 14 14 // … … 26 26 // The first element is always at index 0. 27 27 forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) ) 28 elt_type * begin( array_type array ) {28 elt_type * begin( array_type * array ) { 29 29 return &array[ 0 ]; 30 30 } … … 32 32 // The end iterator should point one past the last element. 33 33 forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) ) 34 elt_type * end( array_type array ) {34 elt_type * end( array_type * array ) { 35 35 return &array[ last( array ) ] + 1; 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.