mirror of
https://github.com/VictorEijkhout/TheArtOfHPC_vol3_cppf08programming.git
synced 2026-01-24 22:44:48 +09:00
16 lines
181 B
C++
16 lines
181 B
C++
class B;
|
|
|
|
class A {
|
|
friend class A;
|
|
protected:
|
|
int i;
|
|
public:
|
|
A(int i) : i(i) {};
|
|
int geti() { return i; };
|
|
};
|
|
|
|
class B : public A {
|
|
public:
|
|
B( A a ) : A(a.geti()) {};
|
|
};
|