I have a circular situation, haven't I? Does it happen only for shared pointers?
The more importantly,the situation above doesn't make the main loop infinite? Afterall one creates another and another creates another and so on...Doesn't it crashes the program?
It's not infinite because you call the nested objects 1 by 1. There's not like "keep going till you reach the bottom of the reference". This is not Excel. The program doesn't look for a "number" to display, but rather simply calls the object you're pointer is pointing at. It could be 10 levels deeper, but it's your call. It won't go 10 levels deeper until you dereference 10 times.
You'll be stunned when you see how Multi-dimensional containers are done with templates by giving a parameter for the dimensionality. That's really circular!!! and that could really drive the compiler (since templates are compile-time stuff) crazy and get it to crash sometimes.
By each constructor creating the other object, you have an infinitely recursive loop. That's clearly wrong. But objects referring to each other of itself isn't necessarily a problem.
Clearly you had something in mind. Can you explain your design? We ought to be able to sort this out.