ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] Re: MPL usage for code generation
by David Abrahams other posts by this author
Jan 23 2003 1:19PM messages near this date
Re: [boost] Re: MPL usage for code generation | Re: [boost] Re: MPL usage for code generation
"Peter Dimov" <pdimov@[...].net>  writes:

>  From: "David Abrahams" <dave@[...].com>
> > 
> > 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
   dave@[...].com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Hugo Duncan
Andrei Alexandrescu
Hugo Duncan
Hugo Duncan
Hugo Duncan
David Abrahams
Peter Dimov
David Abrahams
=?iso-8859-1?Q?Terje_Sletteb=F8?=
=?iso-8859-1?Q?Terje_Sletteb=F8?=
=?iso-8859-1?Q?Terje_Sletteb=F8?=
David Abrahams
Hugo Duncan
Andrei Alexandrescu
David Abrahams
David Abrahams
Andrei Alexandrescu
David Abrahams
Douglas Paul Gregor
David Abrahams
Douglas Paul Gregor
David Abrahams
Douglas Paul Gregor
David Abrahams
Douglas Paul Gregor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved