If you got to remove one feature from #cplusplus, what would it be?
For me, comma operator.
Suppose I have a class that contains a handle to a ref-counted object. When the class gets destructed I want to call releaseRef(handle). Without a copy or move ctor, I could easily call releaseRef() more times than addRef().
-
-
I don't think there's a practical difference. You can implement a method that gives you a handle (and increments the ref count for you), and implement an explicit copy method that correctly copies it (with addref).
-
So how are you going to call releaseRef more than addRef? By memcpying it to another instance maybe, but you can do that now too so it's not really a new issue.
- Näytä vastaukset
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.