From: Mikko Rasa Date: Sat, 3 Aug 2013 12:24:01 +0000 (+0300) Subject: Replace local RAII set utility with one from mspcore X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0d8df25704366f3576c417436c90fbac2e479632;p=libs%2Fdatafile.git Replace local RAII set utility with one from mspcore --- diff --git a/source/loader.cpp b/source/loader.cpp index 2c0fbd1..c2de401 100644 --- a/source/loader.cpp +++ b/source/loader.cpp @@ -1,3 +1,4 @@ +#include #include #include "dataerror.h" #include "loader.h" @@ -7,16 +8,6 @@ using namespace std; namespace { -template -struct Set -{ - T &ref; - T orig; - - Set(T &r, const T &v): ref(r), orig(r) { r = v; } - ~Set() { ref = orig; } -}; - bool signature_match(char s, char a) { if(s==a) @@ -109,7 +100,7 @@ void Loader::load(const Statement &st) void Loader::load_statement(const Statement &st) { - Set set_cst(cur_st, &st); + SetForScope set_cst(cur_st, &st); try {