Boost logo

Boost :

From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2008-05-14 18:16:28

On Wed, May 14, 2008 at 2:34 PM, Marco Costalba <mcostalba_at_[hidden]> wrote:
> On Wed, May 14, 2008 at 5:05 PM, Daniel Walker
> <daniel.j.walker_at_[hidden]> wrote:
> But begin(), end() and fill() need a forward iterator concept to work.
> In it's current form, if I have to do the analogy with a container I
> would say that MSF is more similar to an hash then, say, a vector or a
> list.

Well, it's kind of an associative container - associating a signature
with a callable object. But you should pick whichever concepts you
feel are best suited and would like to support and then implement
them. And again Fusion's concepts may actually be a better starting
point than the STL, since each function object could have a different
type. It may take some work, but it would be worth it.

> First step is to load the gun: Define a MSF object and assign to it
> the functions/functors
> Second step is to shot: Use one or many of these MSF object to make
> the job done (call stuff, dynamic dispatch, handle containers of MSF
> items and so on)

Great analogy!

For shooting the gun you should model function object concepts -
either SGI STL or Fusion or something new if necessary. With
operator() and result_of support you already have about everything a
person could ask for, so this part is basically done.

However, shooting the gun is useless unless it's loaded, and your
current infrastructure for loading the gun is lacking. I would suggest
modeling some container concept for this or Fusion's sequences or
something like them.

Incidentally, would you be interested in contributing this as part of
a larger library for functional programming in C++? I feel like there
could be synergy here with Shunsuke's Egg library. Perhaps, if the
three (or more) of us put our heads together we could come up with
something new and helpful that we could submit to Boost together.

Daniel Walker

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