#include <iostream>
#include <memory>

using std::shared_ptr;
using std::weak_ptr;
using std::make_shared;

class A : public std::enable_shared_from_this<A>
{
public:

	class B{
	public:
		B(shared_ptr<A> ptr)  { //??
			ptrToA = ptr;
		} 
		~B(){}
	private:
		int bNumber{1};
		weak_ptr<A> ptrToA;
	};
	
	
	A(){
		ptrToB = make_shared<B>(shared_from_this());
	}
	~A(){}
	shared_ptr<B> getPtrToB() { return ptrToB; }
	
	

private:
	shared_ptr<B> ptrToB;
	int aNumber{0};
};

int main(){
	A aInstance;
	
	return 0;
}