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++. –