mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-07 20:44:32 +08:00
update
This commit is contained in:
26
codingStyleIdioms/5_pImpl/pimplTime.cpp
Normal file
26
codingStyleIdioms/5_pImpl/pimplTime.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
class C {
|
||||
vector<int> v;
|
||||
string s;
|
||||
};
|
||||
class D {
|
||||
string s;
|
||||
};
|
||||
|
||||
class X {
|
||||
private:
|
||||
struct XImpl;
|
||||
XImpl* pImpl;
|
||||
};
|
||||
|
||||
struct X::XImpl {
|
||||
C c;
|
||||
D d;
|
||||
};
|
||||
|
||||
int main() {
|
||||
X x;
|
||||
}
|
||||
Reference in New Issue
Block a user