Changeset 50b7e8c for doc/generic_types/evaluation/cpp-vbench.cpp
- Timestamp:
- Apr 12, 2017, 10:15:20 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/cpp-vbench.cpp
r549950c r50b7e8c 1 1 #include <algorithm> 2 #include <fstream> 2 3 #include <stdlib.h> 3 4 #include "bench.hpp" 4 5 #include "cpp-vstack.hpp" 6 #include "cpp-vprint.hpp" 5 7 #include "object.hpp" 6 8 … … 45 47 std::make_unique<character>('\0') ); 46 48 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"} ); 49 63 ) 50 64 }
Note: See TracChangeset
for help on using the changeset viewer.