Changeset 8a97248 for tests


Ignore:
Timestamp:
Feb 3, 2023, 1:28:36 PM (15 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
2125443a
Parents:
7a24d76
Message:

switch from old trait syntax to new trait syntax using forall clause

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/forall.cfa

    r7a24d76 r8a97248  
    1010// Created On       : Wed May  9 08:48:15 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  5 10:06:08 2021
    13 // Update Count     : 36
     12// Last Modified On : Thu Feb  2 15:28:45 2023
     13// Update Count     : 38
    1414//
    1515
     
    5656}
    5757
    58 trait sumable( T ) {
     58forall( T ) trait sumable {
    5959        void ?{}( T &, zero_t );                                                        // 0 literal constructor
    6060        T ?+?( T, T );                                                                          // assortment of additions
     
    6464}; // sumable
    6565
    66 forall( T | sumable( T ) )                                              // use trait
     66forall( T | sumable( T ) )                                                              // use trait
    6767T sum( size_t size, T a[] ) {
    6868        T total = 0;                                                                            // initialize by 0 constructor
Note: See TracChangeset for help on using the changeset viewer.