내가 만들려고 다음과 같은 오류지고있어지도에서 읽을 때 :"잘못된 초기화"오류
는error: invalid initialization of non-const reference of type "std::vector<......"
코드 : 나는 그것을 읽어와 한
class Config {
public:
std::vector<string>& GetValuesForList(std::string listName);
private:
std::map<std::string, std::vector<string> > lists;
};
inline std::vector<string>&
Config::GetValuesForList(std::string listName) {
return lists.find(listName);
}
는 것을 C++ 임시 테이블 때문이지만,이를 해결하는 방법은 확실하지 않습니다. 어떤 도움이라도 대단히 감사하겠습니다.
감사합니다.
정말 고마워. 완벽하게 작동했다. – MeanwhileInHell