Q:

Function to find min and max values in a vector, and returning their indexes

I am very new to C++ I just started learning it this week.
As stated in the question, I am trying to find the highest and lowest value in the vector vector<int> pricelist{10,23,45,12,32}so I expect to get a return of 0 and 2. 
public:
Prices(const int lowestPriceIn, const int highestPriceIn)
       : lowestPrice(lowestPriceIn), highestPrice(highestPriceIn) {
   }

I want to put a function in a method lowestNHighestPrices().
I am assuming I can create a loop that iterates through the vector, but how would I determine which would be the lowest and highest value? And how would I get just the indexes and not the elements? 
I have 2 get methods that return 2 int variables, one for the lowest value and the other for the highest.
int getlowestPrice() const {
       return lowestPrice;
   }

   int gethighestPrice() const {
       return highestPrice;
   }

A:

You could use std::minmax_element to get both min and max and their respective indices in one go, in the following way:
std::vector<int> v {10,23,45,12,32};
auto mm = std::minmax_element(v.begin(), v.end());
auto idx_min = std::distance(v.begin(), mm.first);
auto idx_max = std::distance(v.begin(), mm.second);

Live Demo

