|
Boost : |
Subject: Re: [boost] New libraries implementing C++11 features in C++03
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2011-11-24 11:23:35
Dean Michael Berris wrote:
>>> There's *exactly* the same number of lines in a local function as
>>> there is with a class/namespace function. What am I missing?
>>
>> I'm actually also asking myself what I'm missing. Everybody seems to
>> claim that a namespace function provides the same functionality as a
>> local function.
>
> [...]
> It's not that complicated.
>
> The first approach is the way we've been doing it with normal C++. It
> works. It's not broken.
>
> I don't see why we'd ever need Boost.Local at all.
OK, now I understand what you are missing. An important part of the functionality of Boost.Local is to capture variables from the enclosing function. Some even argued that C++ will never have true local functions, because you still have to specify the names of the variables from the enclosing function that you want to capture.
Of course, if you don't need to capture any variable from the enclosing function, using Boost.Local will only make your code more ugly.
Regards,
Thomas
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk