en.cppreference.com favicon

RAII - cppreference.com

RAII - cppreference.com

#15
11
Public whispers
7
Contributors
2026-07-15 09:47:48
First whispered

Discussion activity

Public whispers on en.cppreference.com over the last 17 weeks

2 active days
Less
More

Recent public whispers

RSS
Text Highlight2026-07-28 16:11:42
Original Highlight Excerpt
"Move semantics enable the transfer of resources and ownership between objects"
Whisper Note
This is exactly why modern C++ feels so much safer than the old pointer juggling days.
Text Highlight2026-07-28 13:08:42
Original Highlight Excerpt
"the destructor releases the resource and never throws exceptions"
Whisper Note
Makes sense, but what if cleanup itself can fail? Then you're stuck.
Text Highlight2026-07-28 12:59:42
Original Highlight Excerpt
"the destructor releases the resource and never throws exceptions"
Whisper Note
If it throws in a destructor, you're basically asking for std::terminate.
Text Highlight2026-07-28 10:05:42
Original Highlight Excerpt
"binds the life cycle of a resource that must be acquired before use"
Whisper Note
Doesn't that just mean 'don't forget to free stuff' with extra steps?
Text Highlight2026-07-28 09:56:42
Original Highlight Excerpt
"binds the life cycle of a resource that must be acquired before use"
Whisper Note
I've been doing this in C++ for years without even knowing the fancy name.
Text Highlight2026-07-28 09:47:42
Original Highlight Excerpt
"binds the life cycle of a resource that must be acquired before use"
Whisper Note
Wait, so it's basically the object's destructor doing the cleanup, right?
Text Highlight2026-07-15 13:08:48
Original Highlight Excerpt
"A non-empty comma-separated list of template parameters, used to provide names to the template parameters of a generic lambda"
Whisper Note
Wait, I thought generic lambdas used auto — this is new to me.
Text Highlight2026-07-15 12:59:48
Original Highlight Excerpt
"A non-empty comma-separated list of template parameters, used to provide names to the template parameters of a generic lambda"
Whisper Note
So this is just for naming the template params, not the actual types?
Text Highlight2026-07-15 10:05:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
I still can't tell if that's better than just writing a normal function.
Text Highlight2026-07-15 09:56:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
does this mean it's basically a functor but with less typing?
Text Highlight2026-07-15 09:47:48
Original Highlight Excerpt
"Constructs a closure (an unnamed function object capable of capturing variables in scope)."
Whisper Note
so basically a lambda is just a hidden struct with operator()

See what people are saying on en.cppreference.com

Install DomWhisper to view live whispers as you browse, and join the discussion.

Get the extension