Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-30 13:28:43


David Abrahams <dave_at_[hidden]> writes:

> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
> > From: "David Abrahams" <dave_at_[hidden]>
> > >
> > > I'm at a seminar right now where Steve Dewhurst has presented his
> > > technique for implementing typeof. It has the nice feature that you
> > > only need to register UDTs, and the system is then able to cope with
> > > them in all other type contexts including arrays, pointers, function
> > > (pointers/references), etc., etc. This technique was also covered in a
> > > recent CUJ article. I imagine it /might/ save some significant amount
> > > of code in Boost.Lambda and Spirit's Phoenix extension to take
> > > advantage of this approach. I think implementing it with MPL would
> > > make it a lot easier. Thoughts?
> >
> > What does it say about typeof(std::cout << 5)?
>
> Good question. I'll ask him. If it's not a reference, we're not
> interested.

I'm afraid it's not a reference. Looking back, I don't see how it
could be.

Oh well. He has a very interesting technique of using multidimensional
array types to represent sequences of integers:

  char[i0][i1][i2][i3]...

I think many compilers might like this better than list<int_c<i0>,
int_c<i1>, ...>. We'd just need to define the appropriate iterators.

-- 
                    David Abrahams
dave_at_[hidden] * http://www.boost-consulting.com

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