Boost logo

Boost :

Subject: Re: [boost] Review of Local Exits
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-11-19 17:08:20

On Sat, Nov 19, 2011 at 3:59 PM, Alexander Nasonov <alnsn_at_[hidden]> wrote:
> This is not a full review of the proposed Boost.Local library, I've
> reviewed only Local Exits and a potential merge with Boost.ScopeExit.

Hello Alex and thank you very much for your comments.

> I vote NOT to merge Local Exits with Boost.ScopeExit for the following
> reasons:

I have no problem with local exits and scope exits remaining separate.
Local exits will additionally provide no bindings (void), const
bindings, and binding of this_.

>  - Local Exits feature gives two different interfaces ("variadic" and
>    "sequencing"). In my opinion, it should only document C++0X
>    interface and have a section called something like "What if I don't
>    have a C++0X compliant compiler?" where it will explain an

Yes, the same comment was made by Vicente and Thomas for the entire
Boost.Local. I am happy to just document the variadic syntax and have
an Annex with the sequencing syntax.

>    alternative interface for a transitional period.
>    Some compilers already support enough C++0X features to let you
>    develop a "perfect" interface.
>  - Binding of variables should be modeled after lambda captures. This
>    means no this_ and no void. I really like void and I'd added it if
>    Lorenzo came up with the idea at the time when Boost.ScopeExit was
>    still in development.

FYI, I can write pp code that transforms void, this_, etc into lambda
captures. For example:

TO_CAPTURE(void) // expand to []
TO_CAPTURE(this_, &x) // expand to [this, &x]
TO_CAPTURE( (this_) (&x) ) // expand to [this, &x]

This way SCOPE_EXIT(void) and SCOPE_EXIT( (this_) (&x) ) or even
SCOPE_EXIT(this_, &x) could support void and this_ while still working
on both C++03 and C++11...

>  - For the same reason, const bind& and bind& should be removed from
>    the interface.

Well, if local exits are not merged with scope exits, local exits can
keep const bind&, bind&, this_, void, etc.

Thank you for your comments.

Boost list run by bdawes at, gregod at, cpdaniel at, john at