you are viewing a single comment's thread
view the rest of the comments
[–] 18 points 2 years ago* (4 children)

Because stuff can own other stuff and be owned at the same time. Also, arcane jackarsery.

Edit: if you want to give a function a pointer that it may change this may occur in a constructive way. I.e. replace an owned object.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 5 points 2 years ago (3 children)

    Yeah... But it's usually a good practice to put a struct somewhere between your 30 levels of ownership.

    Exceptions exist, but they are not very common. Also, in C++, operators overloading may help you if you keep needing to write code like this.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 2 years ago (2 children)

    In C++ you should never have owning raw pointers. Unless you have a good reason™.

    Raw pointers are great, but not for ownership.

  • source
  • parent
  • hideshow 2 child comments