Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-05-21 17:19:24


"Arkadiy Vertleyb" <vertleyb_at_[hidden]> writes:

> Your example does compile on VC8 beta -- thanks a lot. Now I'll try to aply
> it to typeof...

I believe I have substantially simplified the implementation of typeof
and fixed the vc8 compatibility problems. See the enclosed
typeof_impl.hpp

I am a little concerned about the implementation. When I saw the
complexity of what the BOOST_TYPEOF macro expanded into, I was a bit
shocked. Aside from what I addressed, the fact that the expression
gets repeated 100 times was really surprising to me -- it seems to me
that asking the compiler to evaluate the type of the expression over
and over could get to be quite expensive. The simplification I've
made results in the expression being repeated "only" 50 times. Is it
possible to do better?

Also, on a stylistic note, the paucity of whitespace in

   namespace boost{namespace type_of{

seems a bit draconian (yes, I'm exercising my vocabulary today ;->).



-- 
Dave Abrahams
Boost Consulting
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