:부스트 '에 대한 호출에 대한 일치 기능 없음 :: property_tree :: ptree_bad_data :: ptree_bad_data()
: 컴파일시class MyCustomException : public boost::property_tree::ptree_bad_data
{
public:
explicit MyCustomException(const std::string& msg): mMsg(msg) {}
virtual ~MyCustomException() throw() {}
virtual const char* what() const throw() { return mMsg.c_str(); }
private:
std::string mMsg;
};
나는 같은 오류를 얻을
error: no matching function for call to ‘boost::property_tree::ptree_bad_data::ptree_bad_data()’ explicit MyCustomException(const std::string& msg): mMsg(msg) {} ^ note: candidate expects 2 arguments, 0 provided explicit MyCustomException(const std::string& msg): mMsg(msg) {} ^
어떤 이유 일 수 있습니까?
표시되는 코드와 오류 메시지가 일치하지 않습니다. 빌드 오류에 대한 질문을 게시 할 때 우리에게 표시되는 [Minimal, Complete, Verifiable Example] (http://stackoverflow.com/help/mcve)의 오류를 사용하십시오. –
@Someprogrammerdude 오류를 편집했습니다. – astre
ptree_bad_data에는 기본 ctor가 없으므로 오류가 발생했습니다. 기본 초기화. –