Boost logo

Boost :

Subject: [boost] [config] Local classes as template parameters
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-04-05 20:35:11


On Sat, Feb 12, 2011 at 5:50 AM, John Bytheway
<jbytheway+boost_at_[hidden]> wrote:
> On 11/02/11 22:29, Lorenzo Caminiti wrote:
>> On Fri, Feb 11, 2011 at 4:31 PM, Lorenzo Caminiti <lorcaminiti_at_[hidden]> wrote:
>>> From: John Bytheway <jbytheway+boost_at_[hidden]>
>>> 2. Might anyone care so much about performance that they absolutely must
>>> have the code inlined?  The answer is probably "yes" (or at least there
>>> will be people who *think* they care, which is also a problem).  For
>>> these people you could, if you choose, provide an alternate
>>> implementation which doesn't indirect through local::function<>, and
>>> thus will only work in C++0x (or C++03 with non-standard extensions).
>>
>> Without inheriting from local::function_base<> and then using
>> local::function_ref<> the local struct cannot be passed as a template
>> parameter in C++. Is this different for C++0x (C++03)?
>
> Yes, in C++0x local structs can be passed as template parameters.
> Obviously, in C++0x there are lambdas too, so you might think your
> library is useless, but I'd expect most compilers to support passing
> local structs as template parameters before they support lambdas, so
> there is some advantage in having this intermediate implementation.
> Also, your macros would allow writing code that worked in C++0x and
> C++03, with the virtual function business in only those compilers/modes
> where it is necessary.

Hello all,

Is there a Boost.Config macro that indicates if the compiler allows
local classes to be passed as template parameters?

Thank you.

--
Lorenzo

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