HTML Code:
std::vector<block>::const_iterator itFirst = my_file_as_blocks.begin(); // inner loop std::vector<block>::const_iterator itCurrent = my_file_as_blocks.begin(); // outer loop std::vector<block>::const_iterator itEnd = my_file_as_blocks.end(); for ( ; itCurrent != itEnd ; ++itCurrent ) { // a for/while for itFirst if ( itFirst != itCurrent ) { // if order IDs match if ( ((itFirst->id1 == itCurrent->id1) || (itFirst->id1 == itCurrent->id2) || (itFirst->id2 == itCurrent->id1) || (itFirst->id2 == itCurrent->id2)) && ((itCurrent->id1 == itFirst->id1) || (itCurrent->id1 == itFirst->id2) || (itCurrent->id2 == itFirst->id1) || (itCurrent->id2 == itFirst->id2))) { if( (itFirst->last_line.find("TIME-DIFF") != std::string::npos )) // if the line stored in last elements of my_file_as_blocks { // contains "TIME-DIFF" // only those blocks where time is not the same for "2nd-ORD-TO-WASH-TIME-DIFF" if(itFirst->time_diff != itCurrent->time_diff) { std::cout << "Found a duplicate:" << std::endl; } // end of IF for wash_time_diff not-equal comparison } // end of IF for existence of "2nd-ORD-TO-WASH-TIME-DIFF" } // end of IF for comparing order IDs } // end of if ( itFirst != itCurrent ) } // end of for ( ; itCurrent != itEnd ; ++itCurrent )
-------------------------
HTML Code:
123 456 789 012 345 123 567 789 123
