Skip to content

C++ class pointer usage issues. #145078

Discussion options

You must be logged in to vote

So first of all it's C++ that hates you not the other way around. You just butchered C++, the code you made makes no sense, and the error messages are pretty straight forward to understand. You clearly lack foundamental knowledge.

Other than that, what exactly are you trying to accomplish with this class?

From what I think you are trying to do, is a class wrapper for a shared pointer that just overloads the operators -> and *.

Let's first get into the stupid errors:

  • You Need to underestand that make_shared<T> needs to be called first to create and allocate memory for a shared_pointer<T>. The alternative would have ben to allocate it manually with the new keyword, like this:
std::shared_…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@DumbestPerson224
Comment options

Answer selected by DumbestPerson224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants