????C++??????????????
???????????? ???????[ 2015/3/18 11:42:44 ] ????????C++ ???? ???? ???????
???????????????????У? ?????????????д?????????£???????????????????????????????????????£?
???????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. ??????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????