I try to find the smallest value in a std::vector
container.
I know std::min_element
works fine. But I am coding for a stm32 chip, that supports c++11
. However, the cross compiler has some issues with <algorithm>
header.
I want a clear and effect way to do that.
Any suggestions will be appreciated.
Generic
std::min_element
implementation might look like this. It returns iterator to minimum andend
for empty range and supports custom comparator function.