As a afterthought though - it seems usage of std::min_element would be even more suitable here
Something along the lines:
#include <algorithm> // std::min_element, std::max_element...
Type: Posts; User: vart
As a afterthought though - it seems usage of std::min_element would be even more suitable here
Something along the lines:
#include <algorithm> // std::min_element, std::max_element...
You should declare variables in the smallest possible scope to avoid such problems...
#include <vector>
class Vehicle
{
public:
int getYear(){return 2015;}
};