this post was submitted on 13 May 2024
1 points (100.0% liked)

C++

1713 readers
76 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] cmeerw@programming.dev 0 points 4 months ago (1 children)

And even the presented fix hurts my eyes. Should have used a unique_ptr or optional.

[โ€“] rasensprenger@feddit.de 0 points 4 months ago

Exactly, raw pointers are very rarely the way to go