void operator()( int ) const {
     try {
         InitializeAndTerminate(MaxThread);
     } catch( std::runtime_error& error ) {
         REPORT("ERROR: %s\n", error.what() );
     }
 }
__TBB_TEST_EXPORT
int main(int argc, char* argv[]) {
#if _MSC_VER && !__TBB_NO_IMPLICIT_LINKAGE
    #ifdef _DEBUG
        ASSERT(!GetModuleHandle(_T("tbb.dll")) && GetModuleHandle(_T("tbb_debug.dll")),
            "debug application links with non-debug tbb library");
    #else
        ASSERT(!GetModuleHandle(_T("tbb_debug.dll")) && GetModuleHandle(_T("tbb.dll")),
            "non-debug application links with debug tbb library");
    #endif
#endif /* _MSC_VER && !__TBB_NO_IMPLICIT_LINKAGE */
    std::srand(2);
    // Set defaults
    MaxThread = MinThread = 2;
    ParseCommandLine( argc, argv );
    try {
        InitializeAndTerminate(MaxThread);
    } catch( std::runtime_error& error ) {
        REPORT("ERROR: %s\n", error.what() );
    }
    for( int p=MinThread; p<=MaxThread; ++p ) {
        if( Verbose ) REPORT("testing with %d threads\n", p );
        NativeParallelFor( p, ThreadedInit() );
    }
    REPORT("done\n");
    return 0;
}
 void operator()( const tbb::blocked_range<long>& r ) const {
     try {
         InitializeAndTerminate(MaxThread);
     } catch( std::runtime_error& error ) {
         std::printf("ERROR: %s\n", error.what() );
     }
 }