Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6205

Re: need argument for try catch blocks

From Edek <edek.pienkowski@gmail.com>
Newsgroups comp.lang.c++
Subject Re: need argument for try catch blocks
Date 2011-06-04 19:34 +0200
Organization ATMAN - ATM S.A.
Message-ID <isdqc4$tfu$1@node2.news.atman.pl> (permalink)
References (9 earlier) <f91a5af8-2923-44f1-9c8d-2a88d9823936@hd10g2000vbb.googlegroups.com> <00adf30f-8d05-4e9f-9539-a33caa2a40b0@d1g2000yqm.googlegroups.com> <2fa307ee-2252-4505-8053-de385ce71e40@z13g2000yqg.googlegroups.com> <isbbvm$io3$1@node2.news.atman.pl> <38d919d7-dfd5-4ed6-9098-8bd2460a5037@k15g2000pri.googlegroups.com>

Show all headers | View raw


> If you code to this idiom, it becomes exceptionally difficult to
> accidentally "leak" something, /and much more importantly/ if you do
> detect a leak, it becomes much easier to reason about where the bug
> is. Find out where that object lost being owned and fix it. It allows
> you to much more easily reason about code correctness in isolation
> from other code.
>
> This implicit calling of functions on stack exit, and for sub-objects,
> is relatively unique to C++ as far as I know.
>

I do agree with almost everything you wrote, expect one thing:
reasoning about it is certainly easy, when things are consistent
and the people involved are on the same page.

> This ownership relationship forms an
> ownership graph, which when properly done is acyclic.

If one could find a solution that would allow cycles without GC...
That's probably the only thing I don't
like about sharing resources or building arbitrary structures. One can
argue this is not that bad in most cases, when this can be handled by
weak references, by avoiding cycles, or by cleaning up (candidate for
RAII style itself).

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: need argument for try catch blocks "Balog Pal" <pasa@lib.hu> - 2011-05-27 17:58 +0200
  Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-05-30 09:43 -0700
    Re: need argument for try catch blocks Öö Tiib <ootiib@hot.ee> - 2011-05-30 11:58 -0700
    Re: need argument for try catch blocks Christopher <cpisz@austin.rr.com> - 2011-05-31 08:57 -0700
      Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-05-31 13:33 -0700
        Re: need argument for try catch blocks Ian Collins <ian-news@hotmail.com> - 2011-06-01 09:03 +1200
          Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-05-31 14:57 -0700
            Re: need argument for try catch blocks "Balog Pal" <pasa@lib.hu> - 2011-06-01 02:06 +0200
          Re: need argument for try catch blocks Öö Tiib <ootiib@hot.ee> - 2011-05-31 16:32 -0700
        Re: need argument for try catch blocks Christopher <cpisz@austin.rr.com> - 2011-06-01 11:42 -0700
          Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-06-02 16:01 -0700
          Re: need argument for try catch blocks Öö Tiib <ootiib@hot.ee> - 2011-06-03 04:27 -0700
            Re: need argument for try catch blocks Christopher <cpisz@austin.rr.com> - 2011-06-03 07:39 -0700
              Re: need argument for try catch blocks Öö Tiib <ootiib@hot.ee> - 2011-06-03 10:43 -0700
              Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-06-03 11:31 -0700
                Re: need argument for try catch blocks Christopher <cpisz@austin.rr.com> - 2011-06-03 12:14 -0700
                Re: need argument for try catch blocks Leigh Johnston <leigh@i42.co.uk> - 2011-06-03 21:22 +0100
                Re: need argument for try catch blocks "Balog Pal" <pasa@lib.hu> - 2011-06-04 17:30 +0200
                Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-06-04 15:16 -0700
                Re: need argument for try catch blocks Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-11 10:22 +0000
                Re: need argument for try catch blocks Edek <edek.pienkowski@gmail.com> - 2011-06-03 21:17 +0200
                Re: need argument for try catch blocks Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-03 18:24 -0700
                Re: need argument for try catch blocks Edek <edek.pienkowski@gmail.com> - 2011-06-04 19:34 +0200
                Re: need argument for try catch blocks Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-04 19:39 -0700
                Re: need argument for try catch blocks Keith H Duggar <duggar@alum.mit.edu> - 2011-06-04 07:22 -0700
                Re: need argument for try catch blocks Edek <edek.pienkowski@gmail.com> - 2011-06-04 19:24 +0200
            Re: need argument for try catch blocks Christopher <cpisz@austin.rr.com> - 2011-06-03 07:51 -0700
              Re: need argument for try catch blocks "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-03 20:57 +0200
              Re: need argument for try catch blocks Dombo <dombo@disposable.invalid> - 2011-06-05 13:29 +0200

csiph-web