Boost logo

Boost :

Subject: [boost] [local] couple questions
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-05-26 18:52:32


1) I notice from

http://svn.boost.org/svn/boost/sandbox/local/libs/local/doc/html/boost_local/Getting_Started.html#boost_local.Getting_Started.installation

that (proposed) Boost.Local has a dependency on Boost.ScopeExit. It seems
that Boost.Local provides all the functionality of Boost.ScopeExit, and then
some; at least, that's what seems to be implied by

http://svn.boost.org/svn/boost/sandbox/local/libs/local/doc/html/boost_local/Alternatives.html#boost_local.Alternatives.local_exits

It would seem reasonable then, maybe, should Boost.Local be accepted, to
remove the dependence on Boost.ScopeExit and officially deprecate
Boost.ScopeExit in favor of Boost.Local's BOOST_LOCAL_EXIT:

http://svn.boost.org/svn/boost/sandbox/local/libs/local/doc/html/boost_local/Tutorial.html#boost_local.Tutorial.local_exits

What are your (you = Lorenzo or anyone else) thoughts regarding that
development path?

2) I haven't read through the docs in *too* much detail yet, but I would
guess from, for example,

http://svn.boost.org/svn/boost/sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html#boost_local.Advanced_Topics.assigning_local_functions

that copying a Boost.Local functor amounts to something less than a deep
copy, and possibly an entirely shallow copy. In other words, does

int x = 0;
void BOOST_LOCAL_FUNCTION_PARAMS( bind(int) x ) { // bind x by value, so a
copy is taken...
    std::cout << ++x << std::endl;
} BOOST_LOCAL_FUNCTION_NAME(f)

boost::function< void ( ) > g(f);

f();
g();

print "1" followed by "2" (my guess), or does it print "1" twice? I may
have missed it entirely, but I'd like the semantics of copying a Boost.Local
functor explicitly spelled out.

P.S.: I noticed in

http://svn.boost.org/svn/boost/sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html#boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters

a misspelling in the comments of the last example,
s/BOOST_IDENTITY_VALE/BOOST_IDENTITY_VALUE/.

- Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk