Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-10-12 02:56:26


Alexander Nasonov wrote:

> David Abrahams wrote:
>> FWIW, we didn't cover as_sequence in the book because we really
>> couldn't come up with a use case that justified the non-uniformity in
>> generic programs. If the type you pass happens to be a sequence
>> already it gets treated differently :(.
>
> I don't quite understand your negative reaction on difference. A lot of
> things are different :)
> If you couldn't find a good use case for generic programs, may be we
> could try find something interesting for "real" (I mean not generic)
> programs?

I have no opinion if as_sequence should be overloaded this way, or not, but
I'd like the function pointer type -> sequence metafunction.

As example, I'm working on Boost.Plugin library, and I'd prefer to change
the current syntax for describing plugin's constructor arguments:

  template<> class virtual_constructors<MyBasePluginClass> {
         typedef mpl::vector< mpl::vector<int>,
         mpl::vector<double> > type;
  };

to

  template<> class virtual_constructors<MyBasePluginClass> {
         typedef mpl::vector<ctor (int), ctor(double)> type;
  };

(Where 'ctor' is dummy syntax sugar type).

- Volodya


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