typedef를 언제 사용해야합니까?
C ++에서 typedef를 사용 해야하는지 여부와 시간에 대해 약간 혼란 스럽습니다. 나는 그것이 가독성과 선명도 사이의 균형 잡힌 행동이라고 생각합니다. typedef가없는 코드 샘플은 다음과 같습니다. int sum(std::vector<int>::const_iterator first, std::vector<int>::const_iterator last) { static std::map<std::tuple<std::vector<int>::const_iterator, std::vector<int>::const_iterator>, int> lookup_table; std::map<std::tuple<std::vector<int>::const_iterator, std::vector<int>::const_iterator>, int>::iterator lookup_it = lookup_table.find(lookup_key); if (lookup_it != lookup_table.end()) return lookup_it->second; ... } …