
13 Mar
2005
13 Mar
'05
5:56 p.m.
I use the following as an implementation detail, and it was mentioned by Pavel that a similar facility called state_saver is used in the implementation of the serialization library. Does it make sense for this to be refactored into boost/detail? template < typename T > struct auto_set { T & var; T val; auto_set ( T & var, T val ) : var ( var ), val ( val ) { } ~ auto_set ( ) { var = val; } }; -Jason