Quantcast
Channel: Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?) - Stack Overflow
Viewing all articles
Browse latest Browse all 18

Answer by Stephen for Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)

$
0
0

One thing to be careful of when using RAII is the size of what is being created, because it's created on the stack, and the stack typically has far less memory available than the heap.

If you're not sure what the size of something is, you might be better not using RAII and creating your object on the heap, being careful to destroy it.


Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>