foo.h
#include"fooImpl.h"
class foo
{
private:
class fooImpl;
std::unique_ptr <fooImpl> foo_imple;
public:
void bar();
};
fooImpl.h
#include "foo.h"
class foo::fooImpl
{
public:
void api();
};
foo.cpp
#include "foo.h"
foo::bar()
{
foo_imple->bar();
}
fooImpl.cpp
#include"foo.h"
#include"fooImpl.h"
void
foo::fooImpl::foo()
{
cout << "bar";
}
Getting the following error:
error: invalid use of incomplete type 'class foo::fooImpl'
foo_imple->bar();
note: forward declaration of 'class foo::fooImpl'
class fooImpl;
Not able to find out whats wrong with this pimpl implementation. Error looks like due to some declaration missing.
Aucun commentaire:
Enregistrer un commentaire