#include #include #include #include "bench.hpp" #include "cpp-stack.hpp" int main(int argc, char** argv) { srand(20171025); stack s; REPEAT_TIMED( "push_int", s.push( rand() ); ) stack t; TIMED( "copy_int", t = s; ) TIMED( "clear_int", s.clear(); ) int max = 0; REPEAT_TIMED( "pop_int", max = std::max( max, t.pop() ); ) stack> s2; REPEAT_TIMED( "push_bool_char", s2.push( std::pair{ rand() & 0x1, rand() & 0x7F } ); ) stack> t2; TIMED( "copy_bool_char", t2 = s2; ) TIMED( "clear_bool_char", s2.clear(); ) std::pair max2 = { false, '\0' }; REPEAT_TIMED( "pop_bool_char", max2 = std::max( max2, t2.pop() ); ) }