Changeset 3fb7f5e for doc/generic_types/evaluation/cpp-vbench.cpp
- Timestamp:
- Apr 14, 2017, 4:51:13 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, 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:
- 1504536, e3de500
- Parents:
- 3895b8b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/cpp-vbench.cpp
r3895b8b5 r3fb7f5e 8 8 9 9 int main(int argc, char** argv) { 10 std::ofstream out{"cpp-vout.txt"}; 10 11 srand(20171025); 11 12 … … 26 27 integer max; 27 28 REPEAT_TIMED( "pop_int", 28 max = std::max( max, t.pop()->as<integer>() ); 29 max = std::max( max, t.pop()->as<integer>() ); /***/ 30 ) 31 print( out, max, c_string{"\n"} ); 32 33 REPEAT_N_TIMED( "print_int", N/2, 34 print( out, integer{rand()}, c_string{":"}, integer{rand()}, c_string{"\n"} ); 29 35 ) 30 36 … … 47 53 std::make_unique<character>('\0') ); 48 54 REPEAT_TIMED( "pop_bool_char", 49 std::unique_ptr<pair> x = as_ptr<pair>( t2.pop() ); 55 std::unique_ptr<pair> x = as_ptr<pair>( t2.pop() ); /***/ 50 56 if ( *x > *max2 ) { max2 = std::move(x); } 51 57 ) 58 print( out, *max2, c_string{"\n"} ); 52 59 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", 60 REPEAT_N_TIMED( "print_pair", N/2, 59 61 print( out, pair{ std::make_unique<boolean>( rand() & 0x1 ), 60 62 std::make_unique<character>( rand() & 0x7F ) }, c_string{":"},
Note: See TracChangeset
for help on using the changeset viewer.