???????????????????У? ?????????????д?????????£???????????????????????????????????????£?
???????impl ?????
?????????impl?????
???????
???????????????????? ????#include ???????????????????????????????????????????±???
???????????????????????????????????й?????
???????
????????impl?????????????????????????????????????????????????????? ??ε????????????????????impl->xxx()????????
????????????????????仯???????????????±???
???????impl?????????????
// ??? file and cx ???麯??.
#include "file.h"
#include "db.h"
class cx;
class error??
class old : public file?? private db {
public:
old( const cx& );
db  get_db( int?? char* );
cx  get_cx( int?? cx );
cx& fun1( db );
error  fun2( error );
virtual std::ostream& print( std::ostream& ) const;
private:
class oldimpl* pimpl; //???????????????
};
inline std::ostream& operator<<( std::ostream& os??const old& old_val )
{ return old_val.print(os); }
//implementation file old.cpp
class oldimpl{
std::list<cx> cx_list_;
deduce        dudece_d_;
};
????3. ??????????????????
??????????????????????????????в??????? old class ???????????????? class old ???file ?? db ?? ???file????м?У????db ????м??
?????????file ??????? ???file ?????麯???? old ???????????? ??????????????裬 ???file ?? cx ???麯??????м??db ????????! ???????????????
??????? ??м??—???????????????????????????????Java??final??????????????????????????????????? ?????????м???????????? ?????e???????????db?????????? ????????
??????"db.h"????????? ??db ????????????impl???У??????????????????
// ??? file and cx ???麯??.
#include "file.h"
class cx;
class error;
class db;
class old : public file {
public:
old( const cx& );
db  get_db( int?? char* );
cx   get_cx( int?? cx );
cx& fun1( db );
error  fun2( error );
virtual std::ostream& print( std::ostream& ) const;
private:
class oldimpl* pimpl; //???????????????
};
inline std::ostream& operator<<( std::ostream& os??const old& old_val )
{ return old_val.print(os); }
//implementation file old.cpp
class oldimpl{
std::list<cx> cx_list_;
deduce        dudece_d_;
};
????С????£?
???????????????????????????????????????
????1. ??????????#include??????? ?????????? (forward declared )
????2. ????????????????г?????????????? "impl" ????
????3. ??????????????????