示例#1
0
int main()
{
    foo f00_1(0);
    foo *f00_ptr = new foo(12);
    
    f00_1.a++; // Set break point at this line.
    
    wrapint test_cast('A' +
               256*'B' +
               256*256*'C'+
               256*256*256*'D');
    
    return 0;
}
示例#2
0
int main()
{
    foo f00_1(0);
    foo *f00_ptr = new foo(12);
    
    f00_1.a++; // Set break point at this line.
    
    wrapint test_cast('A' +
               256*'B' +
               256*256*'C'+
               256*256*256*'D');
    // Set cast break point at this line.
    test_cast.x = 'Q' +
	               256*'X' +
	               256*256*'T'+
	               256*256*256*'F';
    return 0;     // Set second cast break point at this line.
}
示例#3
0
文件: main.cpp 项目: CCJY/coliru
int main()
{
    srand(time(0));

    // The counter is introduced to prevent the compiler
    // from optimizating *everything* away.
    unsigned counter = 0;

    // Print the times for the different strategies.
    print_time(test_std_copy(), counter);
    print_time(test_memmove(),  counter);
    print_time(test_memcpy(),   counter);
    print_time(test_cast(),     counter);

    // Printing the counter to stdout prevents the compiler from
    // optimizing away the inner loop of the benchmark function.
    std::cout << "(counter:  " << counter << ")" << std::endl << std::endl;

}