Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-30 15:27:37


On Wednesday 30 May 2001 03:04 pm, you wrote:
> > > if (allow_typeof) {
> > > typespec = TYPEOF '(' expr ')' | TYPEOF '(' type_id ')';
> > > }
>
> <offtopic>
>
> BTW, I'd love to have typeof. I read somewhere that there
> was a way to simulate this. Any info?

The only solution I've seen for this was proposed by Bill Gibbons, but it
required types to be registered first - making it completely useless for
generic programming where typeof would be most useful.

> I'd also love to have: auto var = <expression>

That'd be nice, too, but the incompatibility with C will likely hinder it.
The nice thing about typeof() is that it fits into the language easily and
most people agree on the semantics of it.

> I hear CW6 and G++3 has typeof. Correct me if I'm wrong.

Yes, g++ 3.0 will have typeof.

> It is not standard but Andrei told me it has a very big chance
> to be standard. So, can we simulate: auto var = <expression>
> with typeof?

typeof(expression) var = expression;

... but it's a real pain to type :).
> </offtopic>
>
> Joel de Guzman

        Doug


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