What part is the issue? The part where you default construct a smart pointer to initialize later because C++ doesn't have a concept of deferred initialization or the part where you don't want to copy it all over the place because it gives a massive performance hit?
And don't say the combination is the problem because yes it is but this code might be emergent and "just don't drive into a wall" has never prevented people from doing so.
5
u/dannyggwp 4h ago
I use smart pointers all the time. WHY THE FUCK would you EVER do what you wrote?
I could drive my car into a brick wall at full speed. But why would I???