28 lines · c
1#ifndef A_H2#define A_H3 4#include <cstdio>5#include <memory>6 7class A {8public:9 A(int value) : m_a_value(value) {}10 A(int value, A *client_A) : m_a_value(value), m_client_A(client_A) {}11 12 virtual ~A() {}13 14 virtual void doSomething(A &anotherA);15 16 int Value() { return m_a_value; }17 18private:19 int m_a_value;20 std::auto_ptr<A> m_client_A;21};22 23A *make_anonymous_B();24 25A *take_A(A *a);26 27#endif28