- Timestamp:
- Aug 8, 2017, 8:04:39 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 533804b
- Parents:
- b0440b7
- Location:
- src/tests/vector
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/vector/array.h
rb0440b7 r9a4e996 22 22 // element has index 0. 23 23 trait array( otype array_type, otype elt_type ) { 24 lvalue elt_type?[?]( array_type, int );24 elt_type & ?[?]( array_type, int ); 25 25 }; 26 26 -
src/tests/vector/vector_int.c
rb0440b7 r9a4e996 61 61 // implement bounded_array 62 62 63 lvalue int?[?]( vector_int * vec, int index ) {63 int & ?[?]( vector_int * vec, int index ) { 64 64 return vec->data[ index ]; 65 65 } -
src/tests/vector/vector_int.h
rb0440b7 r9a4e996 26 26 27 27 void ?{}( vector_int & ); // allocate vector with default capacity 28 void ?{}( vector_int &, int reserve ); 29 void ?{}( vector_int & vec, vector_int other ); 28 void ?{}( vector_int &, int reserve ); // allocate vector with specified capacity 29 void ?{}( vector_int & vec, vector_int other ); // copy constructor 30 30 void ^?{}( vector_int & ); // deallocate vector's storage 31 31 … … 35 35 // implement bounded_array 36 36 37 lvalue int ?[?]( vector_int * vec, int index );// access to arbitrary element (does not resize)38 int last( vector_int * vec ); 37 int & ?[?]( vector_int * vec, int index ); // access to arbitrary element (does not resize) 38 int last( vector_int * vec ); // return last element 39 39 40 40 #endif // VECTOR_INT_H
Note: See TracChangeset
for help on using the changeset viewer.