Changeset 4a9ccc3 for src/tests


Ignore:
Timestamp:
Jan 24, 2017, 3:56:33 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
ad6343e
Parents:
0bfaf80
Message:

propagate sized status through trait instances

Location:
src/tests/vector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/vector/array.c

    r0bfaf80 r4a9ccc3  
    1616#include "array.h"
    1717
    18 /// forall( otype array_type, elt_type | bounded_array( array_type, elt_type ) )
    19 /// [ array_iterator begin, array_iterator end ]
    20 /// get_iterators( array_type array )
    21 /// {
    22 ///   begin = 0;
    23 ///   end = last( array );
    24 /// }
     18forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
     19[ elt_type * begin, elt_type * end ] get_iterators( array_type * array ) {
     20        return [ begin( array ), end( array ) ];
     21}
    2522
    2623// The first element is always at index 0.
  • src/tests/vector/array.h

    r0bfaf80 r4a9ccc3  
    3232// implement iterator_for
    3333
    34 typedef int array_iterator;
    35 
    36 /// forall( otype array_type, elt_type | bounded_array( array_type, elt_type ) )
    37 /// [ array_iterator begin, array_iterator end ] get_iterators( array_type );
     34forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
     35[ elt_type * begin, elt_type * end ] get_iterators( array_type * );
    3836
    3937
Note: See TracChangeset for help on using the changeset viewer.