0
할 수 없습니다 :내가 pimpl 패턴을 만들려고 pimpl
//header
#include <memory>
class Table
{
public:
Table();
private:
class Impl;
std::unique_ptr<Impl> *m_impl;
};
//source
#include <vector>
#include "table.hpp"
struct Table::Impl {
Impl();
};
Table::Table()
: m_impl { std::make_unique<Impl>() }
{
}
을하지만 오류 얻을 : 내가 잘못 할 방법을 해결하는 것을 이해할 수 없다
table.cpp:9: error: cannot convert 'brace-enclosed initializer list' to 'std::unique_ptr*' in initialization : m_impl { std::make_unique() }
합니다.
로 변경
감사합니다! 그것은 바보 같은 오류입니다. C++만을 연구합니다. –