Ignore:
Timestamp:
Apr 12, 2017, 10:15:20 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
19518e8
Parents:
549950c (diff), 0d10090 (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' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-vbench.cpp

    r549950c r50b7e8c  
    11#include <algorithm>
     2#include <fstream>
    23#include <stdlib.h>
    34#include "bench.hpp"
    45#include "cpp-vstack.hpp"
     6#include "cpp-vprint.hpp"
    57#include "object.hpp"
    68
     
    4547                std::make_unique<character>('\0') );
    4648        REPEAT_TIMED( "pop_bool_char",
    47                 std::unique_ptr<object> x = t2.pop();
    48                 if ( x->as<pair>() > *max2 ) { max2.reset( static_cast<pair*>(x.release()) ); }
     49                std::unique_ptr<pair> x = as_ptr<pair>( t2.pop() );
     50                if ( *x > *max2 ) { max2 = std::move(x); }
     51        )
     52
     53        std::ofstream out{"cpp-vout.txt"};
     54        REPEAT_TIMED( "print_int",
     55                print( out, integer{rand()}, c_string{":"}, integer{rand()}, c_string{"\n"} );
     56        )
     57
     58        REPEAT_TIMED( "print_pair",
     59                print( out, pair{ std::make_unique<boolean>( rand() & 0x1 ),
     60                        std::make_unique<character>( rand() & 0x7F ) }, c_string{":"},
     61                        pair{ std::make_unique<boolean>( rand() & 0x1 ),
     62                        std::make_unique<character>( rand() & 0x7F ) }, c_string{"\n"} );
    4963        )
    5064}
Note: See TracChangeset for help on using the changeset viewer.