@sos You are returning by reference. I don't even need to look at the declaration since I'm "familiar" with this error msg.
When you `return Point(..)` it call the constructor and you return a reference to a temporary that will be deleted when you exit the function.
IT MAKE SENSES when you know about it but the error message is not clear at all.
@Remi123 Yeah figured. Just got rid of all references, I hate this :P
@sos Here some link to learn.
https://godbolt.org/z/jrf4674Wr Godbolt is a good web editor to test things out. it has an executor and you can have a tree and cmake view.
https://www.youtube.com/watch?v=07rJOzFRs6M&list=PLHTh1InhhwT4TJaHBVWzvBOYhp27UO7mI&index=19
This is a link to a playlist of Back to Basic for C++. The Smart-pointer and RAII video is imo the most important.
Anything that you google with `Modern C++` is worth at least looking at. Otherwise you get junk