foo.h
Код: Выделить всё
class Foo {
public:
Foo();
private:
class Bar;
std::unique_ptr bar_;
};
Код: Выделить всё
class Foo::Bar {
public:
Bar() { // something smart }
~Bar() = default;
};
Foo::Foo() { // something smart }
недопустимое приложение от 'sizeof' к неполному типу Foo::Bar
Оказывается, если я добавлю следующее, все будет работать нормально:
foo.h
Код: Выделить всё
class Foo {
public:
~Foo();
};
Код: Выделить всё
Foo::~Foo() = default;
Подробнее здесь: https://stackoverflow.com/questions/793 ... ared-class
Мобильная версия