Project update due Tuesday, 10.06.03
Submit to the supervisor of your project.
std::find(c.begin(), c.end(), _1 > 3);To make this work, the expression _1 > 3 must create a Predicate that returns true if its argument is greater than 3. This is achieved by defining the placeholder variable _1 (a placeholder for the argument of the predicate) and its operator> appropriately.
Implement the placeholder variables _1 and _2 to make the following test program (in placeholder.C) to work. Note that the expression _1 > _2 creates a Binary Predicate.
int main() {
const int size = 6;
int a[size] = { 2, 5, 1, 3, 6, 4 };
float b[size] = { 4.0, 6.5, 4.5, 1.0, 5.0, 2.5 };
std::ostream_iterator<int> int_out_iter(std::cout, " ");
std::ostream_iterator<float> float_out_iter(std::cout, " ");
std::cout << "Part (a): ";
std::remove_copy_if(a, a+size, int_out_iter, _1 > 3);
std::cout << " (should be: 2 1 3)" << std::endl;
std::cout << "Part (b): ";
std::remove_copy_if(b, b+size, float_out_iter, _1 > 4.0);
std::cout << " (should be: 4 1 2.5)" << std::endl;
std::cout << "Part (c): ";
std::remove_copy_if(b, b+size, float_out_iter, _1 > 4);
std::cout << " (should be: 4 1 2.5)" << std::endl;
std::cout << "Part (d): ";
std::sort(a, a+size, _1 > _2);
std::copy(a, a+size, int_out_iter);
std::cout << " (should be: 6 5 4 3 2 1)" << std::endl;
}
The placeholders should work with any type, not just with
float and int.
Update your annotated feature diagram according to the feedback from your presentation. Scope your feature diagram for implementation, that is, decide what you are going to implement and what not. Return a report with the annotated feature diagram including the scoping information to your project supervisor. You may also include other additional design details.