On Mon, Mar 12, 2012 at 12:37 PM, avasilev <[email protected]> wrote:

> Unlocker classes? My use case is a conditional auto-unlocker object,
> that may or may not unlock v8, depending on a global setting, so I
>

Here's a template which does that:

    /**
        A sentry class which instantiates a v8::Unlocker
        if the boolean value is true or is a no-op if it is false.
    */
    template <bool> struct V8Unlocker {};

    /**
        Equivalent to v8::Unlocker.
    */
    template <>
    struct V8Unlocker<true> : v8::Unlocker
    {
    };

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to