Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(985)

Unified Diff: src/utils.h

Issue 14147: Refactoring using TempAssign. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
===================================================================
--- src/utils.h (revision 977)
+++ src/utils.h (working copy)
@@ -377,12 +377,14 @@
template <typename T>
class TempAssign {
public:
- TempAssign(T* var, T value): var_(var), old_value_(*var) {
+ TempAssign(T* var, const T& value): var_(var), old_value_(*var) {
*var = value;
}
~TempAssign() { *var_ = old_value_; }
+ const T& old_value() const { return old_value_; };
+
private:
T* var_;
T old_value_;
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698