Boost logo

Boost :

Subject: Re: [boost] [config] Local classes as template parameters
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-04-13 12:44:00

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

Does anyone know if there is such a macro in Boost.Config?

For example, this config macro will tell if the following is allowed or not
(supported by C++03 and later standards):

int main() {
    struct { // Local class.
        void operator()(double x) { std::cout << x << std::endl; }
    } print;

    std::vector v(3);
    v[0] = 1.1; v[1] = 2.2; v[2] = 3.3;

    // The config macro will tell if compiler supports passing local object
`print` as template param or not.
    std::for_each(v.begin(), v.end(), print);

    return 0;

Thanks a lot.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at