-

   rss_forum_sources_ru

 - e-mail

 

 -

 LiveInternet.ru:
: 29.07.2007
:
:
: 80

:


goto vs break & continue

, 18 2020 . 19:01 +
D_KEY:
applegame @
. RAII - , .

?

, RAII .

, , defer/scope(exit).
- .
:
    std::lock_guard lock(mtx);


    mtx.lock();
    scope(exit) mtx.unlock();


, RAII , , ? :)

, bracket pattern haskell:
    main = do
    withFile "foo.txt" ReadMode (\handle -> do
    ...)


, .

scope . :)

. , RAII, .
;)

Ruby Kotlin, . bracket pattern , .


applegame @
, scope(exit) , RAII.

:)

scope try/catch/finally.

, defer/scope(exit) finally( ).
using/with/try-with-resources. , .
with*-. , "" ( RAII), .
RAII . , /.

https://forum.sources.ru/index.php?showtopic=362619&view=findpost&p=3834556

:  

: [1] []
 

:
: 

: ( )

:

  URL