
On Mon, Feb 7, 2011 at 11:42 AM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
On 2/7/2011 12:42 AM, Jeffrey Lee Hellrung, Jr. wrote:
Looking back at the macro expansion Lorenzo supplied, it seems the only use for this boost_local_auxXargs variable is to hold a definite reference to the bound variables struct to be used within BOOST_LOCAL_FUNCTION_END( xxx ). I can see the necessity of this for BOOST_SCOPE_EXIT_END, but BOOST_LOCAL_FUNCTION_END has the name of the local function passed to it, which should be unique to the scope, hence could be used to construct a unique name for the reference to the bound variables struct. So it seems this "awful hack" wouldn't be necessary for (proposed) Boost.Local. Am I missing something?
You're not missing anything. The hack was only introduced to avoid having to use a name in scope_exit, like in Boost.Local.
OK, I will study if this hack is needed for Boost.Local or not (I think, it might in order to support BOOST_LOCAL_FUNCTION_END_RENAME which is actually the one used by BOOST_LOCAL_BLOCK_END and BOOST_LOCAL_EXIT_END but I need to go back and check the code). -- Lorenzo