I have a std::set
which is of type point
struct point
{
int x;
int y;
int z;
};
Suppose I want to perform three different operation on each variable in set i.e
- Find the smallest number from x variables.
- Get missing elements from y variables using set difference.
- Get product of all z variables.
At this point, should i use three predefined alogrithmic functions in sequence or should I write my own alogrithm which would perform all three operations by iterating over the set the once?