Boost logo

Boost :

Subject: Re: [boost] [scope_exit] Doesn't included in Boost yet?
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2009-01-13 10:58:36


On Tue, Jan 13, 2009 at 4:42 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> Giovanni Piero Deretta wrote:
>
>> I still I do not see how can you define *polymorphic* inline functions
>> with ScopeExit or a similar technique (which IIRC is basically 'just'
>> a local class).
>
> instead of expanding the macro to
>
> ...
> R operator()(T1 t1) { ... }
> ...
>
>
> you generate
>
> ...
> template<typename T1>
> R operator()(T1 t1) { ... }
> ...

That's the problem. Unfortunately you can't have a templated local
class. AFAIK, Not even in C++0x.

-- 
gpd

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