성병의 [] 연산자 :지도에 대한 선언이 무엇입니까?왜 std :: map에는 const 접근자가 없습니까?</p> <pre><code>T& operator[] (const key_type& x); </code></pre> <p>가이되지 않는 이유가 :
T& operator[] (const key_type& x);
const T& operator[] const (const key_type& x);
const 메소드의 멤버 맵에 액세스해야 할 때 언제나 유용하기 때문에.
와우 남자, 당신은 주간 스택 교환 뉴스 레터에 그것을 만들었습니다 :) – xtofl
Heheh, cool! Youguys는 멋진 답변을했습니다. – Calder