lavitz
asked on
What pattern is this
Hi,
I saw that in boost::asio.
Maybe someone knows name of this pattern and why/when should i use it or why not.
Its remainds me pimpl idiom.
Pattern looks like this
I saw that in boost::asio.
Maybe someone knows name of this pattern and why/when should i use it or why not.
Its remainds me pimpl idiom.
Pattern looks like this
template <typename ServiceName>
class basic_service
{
typedef ServiceName ImplType
public:
Init()
{
impl_.Init();
}
private:
ImplType impl_
};
From what i see. I could pass different types in template argument:
basic_service<Service1> aaa
basic_service<Service2> bbb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The code: ImplType impl_
is a forward declaration of an opaque pointer, details of which is implemented in the implementation file (generally the corresponding CPP file).
In C++ jargon, this is also known as Compiler firewall.
-XM