"Peter Dimov" <[EMAIL PROTECTED]> writes:

> From: "David Abrahams" <[EMAIL PROTECTED]>
>> 
>> I've been talking with Aleksey recently about how to improve the
>> syntactic situation without losing the separation of concerns that we
>> get, but we didn't come up with anything convincingly better.  I think
>> a long time ago the for_each parameter used to look like:
>> 
>>     class f
>>     {
>>         template <class T>
>>         struct apply
>>         {
>>             static void execute() {...};
>>         };
>>     };
>> 
>> IOW, a metafunction class with a nested 'execute' function.  However
>> that's not really any better syntactically, it has problems carrying
>> state, and it's anti-idiomatic.
>
> The state problem is easy:
>
> struct F
> {
>     template<class T> void execute();
> };

Which isn't usable portably on all broken platforms, nor is it that
different from:

  struct F
  {
      template <class T> void operator()(T) { ... };
  };

it's-a-bag-'o'-tradeoffs-ly y'rs,
dave

-- 
                       David Abrahams
   [EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to