|
Boost : |
Subject: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakable library?
From: Pierre Morcello (pmorcell-cppfrance_at_[hidden])
Date: 2009-09-06 16:05:56
>>>>>if you need a construct that forms a scope, accomplishes a tasks and then
exists the scope from anywhere in between, that's a function.
Yes, I remember thinking like this at the beginning. But declaring a function each times sometimes makes the code less readable. It's like declaring a functor for iterating over all objects of a collection : you can do it but BOOST_FOREACH is just much more readable. What is more you need to give a name to your function. It's just more complicated than just writing the name of the macro.
Creating a function when you only want to solve a break-scope problem is doing too much IMHO. It's using a specific aspect of the language that allows to break anywhere, not a tool that is meant to do it.
Best regards,
Pierre
--- En date de : Dim 6.9.09, Stefan Strasser <strasser_at_[hidden]> a écrit :
De: Stefan Strasser <strasser_at_[hidden]>
Objet: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakable library?
À: boost_at_[hidden]
Date: Dimanche 6 Septembre 2009, 13h43
Am Sunday 06 September 2009 20:46:42 schrieb Pierre Morcello:
> Hi,
>
> >>>>>I thought you were talking about a set of macros???
>
> It is a set of macro because there is also a 'breakable if' and also
> 'breakable else'.
>
> >>>>However, the idea is sufficient for me, I can just declare the macro
> >>>> myself
>
> Yes, I can understand that : I used to do the same than
> boost::non_copiable.. But I don't want to keep good ideas for myself.
>
> There is clearly no technical difficulties here. It's more declaring :
> "there is an interesting way of programming some tedius tasks that use
> if/else/ do while contructs everywhere".
I've never seen such a case anywhere, let alone everywhere.
if you need a construct that forms a scope, accomplishes a tasks and then
exists the scope from anywhere in between, that's a function.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk