Hi,
I have problem with pimpl idiom used with namespaces
--file1--
namespace space_a {
namespace implementation {
class Impl
{
public:
Impl();
void test();
};
}}
--file2--
#include file1
namespace space_a {
class A
{
public:
A();
private:
// here impl declaration *pimpl_;
// without namespaces i could do
// class Impl* pimpl_;
};
A::A()
{
pimpl_->test();
}
}
Open in new window
I have tried this also but i get unresolved error
--file1--
namespace space_a {
namespace implementation {
class Impl
{
public:
Impl();
void test();
};
}}
--file2--
#include file1
namespace space_a {
// new
namespace implementation {
class Impl;
}
class A
{
public:
A();
private:
//new
implementation::Impl* pimpl_;
};
A::A()
{
pimpl_->test();
}
}
Open in new window
All is ok if class A is not in namespace