#include #include #include #include "bench.h" #include "cfa-stack.h" #include "cfa-pair.h" #include "cfa-print.h" int main( int argc, char * argv[] ) { ofstream out = { "/dev/null" }; int max = 0, val = 42; stack( int ) s, t; REPEAT_TIMED( "push_int", N, push( s, val ); ) TIMED( "copy_int", t = s; ) TIMED( "clear_int", clear( s ); ) REPEAT_TIMED( "pop_int", N, int x = pop( t ); max = max( x, max ); ) REPEAT_TIMED( "print_int", N/2, out | val | ':' | val | endl; ) pair( _Bool, char ) max = { (_Bool)false, '\0' }, val = { (_Bool)true, 'a' }; stack( pair( _Bool, char ) ) s, t; REPEAT_TIMED( "push_pair", N, push( s, val ); ) TIMED( "copy_pair", t = s; ) TIMED( "clear_pair", clear( s ); ) REPEAT_TIMED( "pop_pair", N, pair(_Bool, char) x = pop( t ); max = max( x, max ); ) REPEAT_TIMED( "print_pair", N/2, out | val | ':' | val | endl; ) }