Every time I want to pass a shared pointer to a function, it makes sense to pass it by reference. Is there any reason not to? #programming
@MachineLinguist the lifetime of the function is less than that of the outer shared pointer. Unless you are multithreading very poorly.
-
-
@MachineLinguist so why bother with another add ref and remove ref? Like, if your most outer scope of the shared ptr has a ref, all inner -
@MachineLinguist scopes don't need to add it themselves as well. You're just giving the computer redundant work.
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.