@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.

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.

youtube.com/watch?v=07rJOzFRs6

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

@Remi123 The problem is I do not wish to learn anything about C++. I just need C with classes and I'm gonna roll it as such.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml