3 ms·
Considering this limitation, I wonder if the syntax could have been something else than assignment. Like maybe: using getResource() as res;
by pavlov 3y ago
Considering this limitation, I wonder if the syntax could have been something else than assignment. Like maybe:
using getResource() as res;
- kybernetikos 3y agoI agree. If it's assignment then it should work the same as assignment (from the users perspective), otherwise it should have a different syntax.
- pavlov 3y agoAlso seems like there would be use cases where you don't even want to assign the result, you just want the destructor to run at the end of the scope. Something like: using someMutex.lock(); With the assignment syntax it's not obvious to me whether that's allowed.
- lillecarl 3y agoYou assign it to a variable that is then disposed of once it's out of scope?