Le 16/11/11 16:41, Paul A. Bristow a écrit :

From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jeffrey Lee Hellrung, Jr.
Sent: Thursday, November 10, 2011 5:53 AM
To:
boost-announce@lists.boost.org; boost-users@lists.boost.org
Subject: [Boost-users] [boost] Boost.Local Review (Nov 10, 2011 to Nov 19, 2011)

 

The review of Lorenzo Caminiti's proposed Boost.Local library begins tomorrow, ***November 10, 2011***, and ends on ***November 19, 2011***.

Other questions you may want to consider:

- What is your evaluation of the design?

 

I have some concern about manipulation of C++ to do things it wasn't really designed to:

 

if C++ is intended to have local functions, it should be part of the language.

If I'm not wrong lambdas play a role similar to unnamed local functions, and they are already in the language. The intent of Boost.Local is to provide something similar on compilers that doesn't support lambdas.

 

'Abuse' like this tends to cause trouble, and more important, it puts off the day when we abandon this "absurdly ambiguous language" in favour of new language X (or have we run out of letters for new languages? ;-) un-shackled by any primitive and obsolete features inherited from C.

Well, you know, the first uses of exceptions and templates in C++ were possible thanks to some preprocessor magic libraries. While incomplete, these 'emulations' allowed to some of us to start using these features and surely pushed to include them properly on the language later on. The preprocessor is a really useful tool that has his place in such contexts.

Unfortunately, the local function emulation needs to bind explicitly the used variables. I think, that even with lambdas in the language, local functions will have his place, as soon as they provide access to the enclosing function data.

 

But that hasn't stopped many people making good use of such devices, for example, Boost.Parameter.

Yes this is another example of things that could be included in the language and in this case that can be emulated using a library.


I understand that a language can not include all the features desired by each user, and that there could be other missing features with a higher added value, but there is one feature that I think is missing in C++: the scoped exit/success/failure as defined in language D. I hope the emulation of Boost.ScopedExit or Boost.Local could show its usefulness and that someone will make a concrete proposal to the standard committee.

Best,
Vicente