Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-08-22 22:09:50

on Fri Aug 22 2008, "Peter Dimov" <> wrote:

> David Abrahams:
>> on Wed Aug 20 2008, "Peter Dimov" <> wrote:
>>> Hi,
>>> Assume that I have a custom type sequence S that has two operations,
>>> size<S>::value and element<S,I>::type (with whatever spelling).
>>> What needs to be done to adapt S into a conforming MPL or Fusion
>>> sequence?
>>> In a perfect world, the answer would not require the inclusion any MPL
>>> or Fusion headers and would consist of three specializations. ;-)
>> Well, if it's an MPL sequence it's a fusion sequence, IIUC. So you need
>> to decide which sequence to model
> My original S is a random access sequence, so I'd probably want to
> model that.
>> According to
>> you can make a forward sequence with 5 specializations.
> That's manageable, but I'd need a random access iterator first. An
> integral constant, too, if I really don't want to include an MPL
> header. It would've been nice if I could just point MPL to size<> and
> element<> and tell it to build the rest of the required
> boilerplate. Patches welcome, you say? :-)

Always :-)

Dave Abrahams
BoostPro Computing

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