, 19 2020 . 13:02
+
D_KEY:
applegame @ PQClear libpq , scope(exit) Connection.
. , .
, . ? :)
"" . , , RAII .
, , .
, , . .
"". , RAII bracket pattern . "" , - "" .
scope(...) ( using/with/try-with-resources, , ) RAII.
scope(exit)
bracket pattern, bracket pattern, scope(exit), ? scope(exit) , try...catch, ;)
, , scope(exit) finally, .
D_KEY @ RAII . , /.
, , .

, bracket pattern RAII ?
korvin @ applegame @ defer (Go?)
f, err := os.Open("some/file")
if err != nil { return err }
defer f.Close()
, , try-with-resources? with*- ?
https://forum.sources.ru/index.php?showtopic=362619&view=findpost&p=3834610
:
Holy Wars