Boost logo

Boost :

Subject: Re: [boost] [SCOPE_EXIT] compiler errors for structure members
From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2009-04-20 10:28:25


Sid Sacek <ssacek <at> securewatch24.com> writes:
> struct {
>
> int one;
>
> } test ;
>
> test.one = 55;
>
> BOOST_SCOPE_EXIT( ( test.one ) )
>
> {
>
> }
>
> BOOST_SCOPE_EXIT_END
>
> The above code gives me lots of compiler errors. Is there a special
> syntax I have to provide to be able to use structure members?
>

This is not supported because only identifiers are allowed. If test was
a variable of non-local non-anonymous struct type, you could pass it:

BOOST_SCOPE_EXIT( (test ) ) { int one = test.one; ... } BOOST_SCOPE_EXIT_END

Alex


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