Boost logo

Boost :

From: Hans Larsen (hans_at_[hidden])
Date: 2007-04-04 22:02:50


Hey guys. Very interesting this problem is and the proposed
solutions leads one to another :)

Problem underlined below.

On 4-Apr-07, at 6:27 PM, Steven Watanabe wrote:

> Alexander Nasonov <alnsn <at> yandex.ru> writes:
>
>> I'm very impressed how you wrote it off the top of your head :->
>
> I didn't. I've been toying with it for a
> couple of days.
>
>> But it's definitely too much magic. Though, it made me think of
>> another magic: study alloca implementations and replace a global
>> variable with something like
>>
>> <snip>
>
> Why do you need this magic?
>
> BOOST_SCOPE_EXIT( (hello)(world) ) // line 1
> /* Expands to:
> struct args_line1_t { std::string &hello, &world; }
> args_line1 = {
> hello, world
> };
> struct scope_exit_line1 {
> args_line1_t* m_args;
> ~scope_exit() {
> doit(p->hello, p->world);
> }
> static void doit(std::string& hello, std::string& world)
> */
> {
> // scope(exit) code
> }
> BOOST_SCOPE_EXIT_END // line 5
> /*
> } scope_exit_line5 = { &args_line1 };

How do you know that it is args_line1? You cannot use __LINE__,
since it is == 5.

Hans

> */
>
> In Christ,
> Steven Watanabe
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/
> listinfo.cgi/boost


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