开发者

Formal treatment of RAII and/or safe deallocations in C++

开发者 https://www.devze.com 2023-04-04 16:46 出处:网络
Are there any research papers on formal treatment of RAII and/or 开发者_运维百科safe deallocations in C++?Take a look at \"A Mechanized Semantics for C++ Object Construction and

Are there any research papers on formal treatment of RAII and/or 开发者_运维百科safe deallocations in C++?


Take a look at "A Mechanized Semantics for C++ Object Construction and Destruction, with Applications to Resource Management" (page, different PDF version), which has apparently been submitted to POPL 2012; but AFAIK has not yet been peer reviewed.

There is a section specifically on RAII, although it may not prove what you want:

We cannot prove a general result guaranteeing the proper encapsulation of resources in classes: this is a matter of program verification. We can, however, prove that in a terminating program every construction of a subobject is correctly matched by a destruction.

Disclaimer: I've only briefly skimmed the paper, and I know almost nothing about formal language semantics.

0

精彩评论

暂无评论...
验证码 换一张
取 消