Ignore:
Timestamp:
Apr 15, 2016, 12:03:11 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
29ad0ac
Parents:
c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/array.h

    rc5833e8 r0f9e4403  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan 26 17:09:29 2016
    13 // Update Count     : 3
     12// Last Modified On : Wed Mar  2 18:13:35 2016
     13// Update Count     : 5
    1414//
    1515
     
    2121// An array has contiguous elements accessible in any order using integer indicies. The first
    2222// element has index 0.
    23 context array( type array_type, type elt_type ) {
     23trait array( otype array_type, otype elt_type ) {
    2424        lvalue elt_type ?[?]( array_type, int );
    2525};
    2626
    2727// A bounded array is an array that carries its maximum index with it.
    28 context bounded_array( type array_type, type elt_type | array( array_type, elt_type ) ) {
     28trait bounded_array( otype array_type, otype elt_type | array( array_type, elt_type ) ) {
    2929        int last( array_type );
    3030};
     
    3434typedef int array_iterator;
    3535
    36 /// forall( type array_type, elt_type | bounded_array( array_type, elt_type ) )
     36/// forall( otype array_type, elt_type | bounded_array( array_type, elt_type ) )
    3737/// [ array_iterator begin, array_iterator end ] get_iterators( array_type );
    3838
     
    4040// A bounded array can be iterated over by using a pointer to the element type. These functions
    4141// return iterators corresponding to the first element and the one-past-the-end element, STL-style.
    42 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
     42forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
    4343elt_type *begin( array_type );
    4444
    45 forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
     45forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
    4646elt_type *end( array_type );
    4747
Note: See TracChangeset for help on using the changeset viewer.