Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////////////
- // oneclass.h
- struct Oneclass{
- template<class T> double Foo(const T& val) const{
- // Do Something
- }
- }
- /////////////////////////////////////////////////////////////////////////
- // myclass_p.h
- #include "oneclass.h"
- #include "myclass.h"
- struct MyCalassPrivate{
- Oneclass m_member;
- }
- /////////////////////////////////////////////////////////////////////////
- // myclass.h
- class MyCalassPrivate;
- class MyClass{
- MyCalassPrivate* d_ptr;
- public:
- MyClass();
- virtual ~MyClass();
- template<class T> double getFoo(const T& val) const;
- }
- /////////////////////////////////////////////////////////////////////////
- // myclass.cpp
- #include "oneclass.h"
- #include "myclass.h"
- #include "myclass_p.h"
- MyClass::MyClass()
- :d_ptr(new MyCalassPrivate())
- {}
- MyClass::~MyClass(){
- delete d_ptr;
- }
- template<class T> double getFoo(const T& val) const{
- return d_ptr->m_member.Foo(val);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement