Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename Ref>
- struct ScopedCF
- {
- public:
- ScopedCF(Ref r) : r(r) { }
- ~ScopedCF() { if (r) CFRelease(r); }
- operator Ref () const { return r; }
- Ref get() const { return r; }
- private:
- ScopedCF(const scoped_CF &);
- ScopedCF &operator= (const scoped_CF &);
- Ref r;
- };
Advertisement
Add Comment
Please, Sign In to add comment