find()
이 아닌 이유는 std::unordered_set()
에 있습니까? find()
의 const가 아닌 버전이 왜std :: unordered_set의 non-const find()
iterator find(const Key& key);
const_iterator find(const Key& key) const;
iterator
는 const_iterator
과 동일? 발견의 const가 아닌 버전이 왜
http://en.cppreference.com/w/cpp/container/unordered_set/find
@ FrançoisAndrieux'find()'*** 메소드와'find()/* no const * /'지정자에 대해 얘기하고 있습니다. – vladon
다른 모든 컨테이너와 일관성을 유지합니다. set 키가 불변인데도 이것은 다른 컨테이너에서 작동 할 수있는 템플릿의 개발을 가능하게하고, 컨테이너가'iterator' 멤버 클래스와 적절한'find()'에 대한 적절한 정의를 제공 할 것으로 기대하는 템플릿을 갖게합니다. –
@vladon 나는 그 질문을 오해했다. 나는 당신이 non-const iterator를 얻기 위해'find '를 사용하는 방법을 묻고 있다고 생각했다. –