代码之家  ›  专栏  ›  技术社区  ›  Lev

Symbian的自动指针

  •  0
  • Lev  · 技术社区  · 16 年前

    有没有自动指针,类似于 auto_ptr 或 scoped_ptr ,对于Symbian?

    1 回复  |  直到 16 年前
        1
  •  1
  •   Haspemulator    16 年前

    不幸的是,不,如果你是指本地的Symbian C++,当然。我只能建议你用 template <class T> class TAutoClose ,可用于调用 Close()

    RFile myFile;
    TAutoClose<RFile> iFile;
    iFile.iObj = myFile;
    

    myFile::Close() 当iFile超出范围时将调用。

    希望这有帮助。Symbian开发并非易事。:)