Boost logo

Boost :

Subject: Re: [boost] [local] What do you think of the new syntax?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-02-28 07:43:39


On 28/02/2011 04:07, Lorenzo Caminiti wrote:
> Hello all,
>
> Before I spend 2+ weeks updating Boost.Local docs... can you please
> express an opinion about Boost.Local new and simplified syntax?
>
> If variadic macros are supported by your compiler:
>
> #include<boost/local/function.hpp>
> #include<iostream>
>
> int main() {
> double sum = 0.0;
> int factor = 10;
>
> void BOOST_LOCAL_FUNCTION_PARAMS(double num, const bind factor,
> bind& sum) {
> sum += factor * num;
> std::clog<< "Summed: "<< sum<< std::endl;
> } BOOST_LOCAL_FUNCTION_NAME(add)
>
> add(100.0);
> return 0;
> }

Nice!


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