Boost logo

Boost :

Subject: Re: [boost] [cpp0x] Macro to support some C++0x syntax and functionality
From: Bo Persson (bop_at_[hidden])
Date: 2010-04-05 07:07:51


Lorenzo Caminiti wrote:
>
> What do you think of the following macro that implementes this in
> ISO
> standard C++ while keeping the above C++0x-like syntax by wrapping
> it
> within a preprocessor sequence?
>
> BOOST_CPP0X_FUNCTION(
> (template)( (std::CopyConstructible)(T) )
> (requires)( (Addable<T>) (Assignable<T>) )
> (precondition)( (first) (last) )
> (postcondition)(total)( (total == result) )
> (T) (sum)( (T*)(first) (T*)(last) (T)(result) ) ({
> for (; first != last; ++first)
> result = result + *first;
> return result;
> }) )
>

This reminds me about the time when I tried out LISP programming, but
didn't like it. To me it looks like there is very little C++ left in
there, sorry.

Bo Persson


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