我该如何保存min_element的值?它被称为前向迭代器,但我似乎无法弄清楚如何保存(赋值给变量)。我希望能够通过向量中的位置访问它。我只能找到使用实际元素的示例(使用* min_element())。我尝试了以下代码:
auto min_word_iterator = min_element(first_words_in_subvecs.begin(), first_words_in_subvecs.end());
但是那不起作用。我将用不同的元素替换该索引处的元素。
auto minIt = ...
。 - GManNickG