瀏覽代碼

Remove ScopeGuard

Turo Lamminen 7 年之前
父節點
當前提交
2c3558fdd0
共有 1 個文件被更改,包括 0 次插入36 次删除
  1. 0 36
      code/BaseImporter.h

+ 0 - 36
code/BaseImporter.h

@@ -65,42 +65,6 @@ class IOStream;
 #define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
 #define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
     (string[1] << 16) + (string[2] << 8) + string[3]))
     (string[1] << 16) + (string[2] << 8) + string[3]))
 
 
-// ---------------------------------------------------------------------------
-template <typename T>
-struct ScopeGuard
-{
-    explicit ScopeGuard(T* obj) : obj(obj), mdismiss() {}
-    ~ScopeGuard () throw() {
-        if (!mdismiss) {
-            delete obj;
-        }
-        obj = NULL;
-    }
-
-    T* dismiss() {
-        mdismiss=true;
-        return obj;
-    }
-
-    operator T*() {
-        return obj;
-    }
-
-    T* operator -> () {
-        return obj;
-    }
-
-private:
-    // no copying allowed.
-    ScopeGuard();
-    ScopeGuard( const ScopeGuard & );
-    ScopeGuard &operator = ( const ScopeGuard & );
-
-    T* obj;
-    bool mdismiss;
-};
-
-
 
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 /** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
 /** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface