Finally in C++

后端 未结 6 1545
南旧
南旧 2020-12-28 08:33

Is this a good way to implement a Finally-like behavior in standard C++? (Without special pointers)

class Exception : public Exception
    { public: virtual          


        
6条回答
  •  清酒与你
    2020-12-28 09:17

    My advice is: don't try to emulate the behaviour of a try-finally clause in C++. Just use RAII instead. You'll live happier.

提交回复
热议问题