diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 00:11:36 +0100 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:34 +0100 |
| commit | 9e49e88d0cc3e6336754040eeaab7a760645dd79 (patch) | |
| tree | 0a71606cabde4b99c3183a744dd16b37e1560ef7 | |
| parent | f0f420be3d80366a54598f6742ef73114651f3c4 (diff) | |
undo.push_var() and undo.push_str() return references so calls can be used as l-values (common use case)
| -rw-r--r-- | undo.h | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -100,28 +100,30 @@ public: uptr_t wParam = 0, sptr_t lParam = 0); template <typename Type> - inline void + inline Type & push_var(Type &variable, Type value) { push(new UndoTokenVariable<Type>(variable, value)); + return variable; } template <typename Type> - inline void + inline Type & push_var(Type &variable) { - push_var<Type>(variable, variable); + return push_var<Type>(variable, variable); } - inline void + inline gchar *& push_str(gchar *&variable, gchar *str) { push(new UndoTokenString(variable, str)); + return variable; } - inline void + inline gchar *& push_str(gchar *&variable) { - push_str(variable, variable); + return push_str(variable, variable); } void pop(gint pos); |
