文件名称:raii_with:一个简单的库,可使用raii_with(resource,initializer,destructor){...}语法在符合标准的C99中提供RAII
文件大小:6KB
文件格式:ZIP
更新时间:2024-05-19 21:34:02
c99 raii C
莱伊 一个简单的库,可使用raii_with(resource, initializer, destructor) { ... } -syntax在符合标准的C99中提供RAII(或类似的东西raii_with(resource, initializer, destructor) { ... } : # include " raii/raii.h " int main () { raii_with ( int *myint, safe_malloc ( sizeof ( int )), free){ *myint = 10 ; printf ( " myint is located at %p and contains: %d \n " , myint, *myint); printf ( " %s \n " , __func__); } int re
【文件预览】:
raii_with-master
----LICENSE(1KB)
----README.md(4KB)
----raii()
--------raii.h(5KB)
--------raii.ih(128B)
--------raii_destruct_with_lifetime.c(218B)
----.gitignore(429B)
----main.c(1KB)