Boost logo

Boost :

From: Reggie Seagraves (reggie_at_[hidden])
Date: 2000-02-07 12:59:29


Ladies and Germs,

        scoped_XXX is what we use in some of our internal libraries already...
....
        i.e. I think scoped_ is the 'right' prefix to use to name this puppy.
                Thanks,
                        Reggie

At 11:26 PM -0500 2/6/00, Stephen C. Gilardi wrote:
>> > We are treating this like a temporary push to the top of a "stack" of
>> > values for the given variable.
>> >
>> > How does this sound for readability:
>> >
>> > {
>> > block_push_value push(mDisableUpdates, true);
>> > block_push_value push2(mEnableLogging, true);
>> > }
>> >
>> > --Steve
>> >
>> Both of these suggest to me that we are setting the value of the
>>variable to true for the CURRENT scope or block, and that the original value
>>will be restored once the block is exited. This is the exact opposite of
>>what the class actually does. This is why I prefer set_value_on_exit. It
>>makes it clear exactly when the variable takes on the value.
>
>The impression you got from the names is exactly the impression I was
>trying to convey. I believe we're talking about two different
>classes which are probably both useful. The one I'm talking about
>sets the value on construction and restores the previous value on
>destruction. It's StValueChanger<T> in PowerPlant.
>
>"scoped_value" seems good to me too.
>
>--Steve
>
>
>------------------------------------------------------------------------
>-- Talk to your group with your own voice!
>-- http://www.egroups.com/VoiceChatPage?listName=boost&m=1


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk