特定の値がまだ に含まれていないことが確実で、そのunordered_set
ような値を挿入する場合、このセットend()
イテレータをヒントとして渡すのは正しいですか?
編集:
コード:
#include <unordered_set>
using namespace std;
unordered_set<int> someset;
int main(){
auto it=someset.find(0);
if(it==someset.end()) someset.insert(it, 0); //correct? possible performance boost if the set is actually populated?
}