ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        with_gc
      
      
        
          | 
            Last change
 on this file since 87555b7 was             79d4186, checked in by Aaron Moss <a3moss@…>, 8 years ago           | 
        
        
          | 
             
Update evaluation code for paper 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            642 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <algorithm>
 | 
|---|
| 2 | #include "bench.hpp"
 | 
|---|
| 3 | #include "cpp-stack.hpp"
 | 
|---|
| 4 | #include "cpp-pair.hpp"
 | 
|---|
| 5 | 
 | 
|---|
| 6 | int main(int argc, char** argv) {
 | 
|---|
| 7 |         int maxi = 0, vali = 42;
 | 
|---|
| 8 |         stack<int> si, ti;
 | 
|---|
| 9 |         
 | 
|---|
| 10 |         REPEAT_TIMED( "push_int", N, si.push( vali ); )
 | 
|---|
| 11 |         TIMED( "copy_int", ti = si; )
 | 
|---|
| 12 |         TIMED( "clear_int", si.clear(); )
 | 
|---|
| 13 |         REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop() ); )
 | 
|---|
| 14 | 
 | 
|---|
| 15 |         pair<bool, char> maxp = { false, '\0' }, valp = { true, 'a' };
 | 
|---|
| 16 |         stack<pair<bool, char>> sp, tp;
 | 
|---|
| 17 |         
 | 
|---|
| 18 |         REPEAT_TIMED( "push_pair", N, sp.push( valp ); )
 | 
|---|
| 19 |         TIMED( "copy_pair", tp = sp; )
 | 
|---|
| 20 |         TIMED( "clear_pair", sp.clear(); )
 | 
|---|
| 21 |         REPEAT_TIMED( "pop_pair", N, maxp = std::max( maxp, tp.pop() ); )
 | 
|---|
| 22 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.