> On Dec 26, 2016, at 9:04 AM, Saam Barati <sbar...@apple.com> wrote:
> 
> Right. I see what you're saying. The name doesn't confuse me with respect to 
> these semantics but I see that's it's subtly wrong.
> 
> The use case I was thinking of is this:
> `
> class Foo {
>    Foo() : m_change(someIntVariable, 20) { }
>    ...
>    ...
>    ScopedChange<int> m_change;
> };
> `
> 
> Which is admittedly an odd use case that probably doesn't exist in WebKit. 
> However, if this use case were common, the name ScopedChange feels wrong for 
> it. 

When you have a class intended for RAII-like use, making it also work as a data 
member or a heap object is a bit of a fool's errand. So I think it's ok to not 
account for this. If there was a sensible way to make a class only usable as 
local variable stack objects then this would be a great place to do it, though 
I don't think C++ has a good way to do that.

Regards,
Maciej

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to