Changeset 8e4aa05 for libcfa/src/stdlib.cfa
- Timestamp:
- Mar 4, 2021, 7:40:25 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 77d601f
- Parents:
- 342af53 (diff), a5040fe (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.cfa
r342af53 r8e4aa05 28 28 // Cforall allocation/deallocation and constructor/destructor, array types 29 29 30 forall( dtype T | sized(T), ttype TT| { void ?{}( T &, TT ); } )30 forall( T & | sized(T), TT... | { void ?{}( T &, TT ); } ) 31 31 T * anew( size_t dim, TT p ) { 32 32 T * arr = alloc( dim ); … … 37 37 } // anew 38 38 39 forall( dtype T| sized(T) | { void ^?{}( T & ); } )39 forall( T & | sized(T) | { void ^?{}( T & ); } ) 40 40 void adelete( T arr[] ) { 41 41 if ( arr ) { // ignore null … … 48 48 } // adelete 49 49 50 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype TT| { void adelete( TT ); } )50 forall( T & | sized(T) | { void ^?{}( T & ); }, TT... | { void adelete( TT ); } ) 51 51 void adelete( T arr[], TT rest ) { 52 52 if ( arr ) { // ignore null … … 97 97 //--------------------------------------- 98 98 99 forall( otypeE | { int ?<?( E, E ); } ) {99 forall( E | { int ?<?( E, E ); } ) { 100 100 E * bsearch( E key, const E * vals, size_t dim ) { 101 101 int cmp( const void * t1, const void * t2 ) { … … 156 156 157 157 158 forall( otype K, otypeE | { int ?<?( K, K ); K getKey( const E & ); } ) {158 forall( K, E | { int ?<?( K, K ); K getKey( const E & ); } ) { 159 159 E * bsearch( K key, const E * vals, size_t dim ) { 160 160 int cmp( const void * t1, const void * t2 ) {
Note:
See TracChangeset
for help on using the changeset viewer.