From: John Torjo (john.lists_at_[hidden])
Date: 2003-10-10 01:25:04
A little bit late, please send me the latest code on
----- Original Message -----
From: "Joel de Guzman" <djowel_at_[hidden]>
To: "Boost" <boost_at_[hidden]>
Sent: Wednesday, September 24, 2003 1:40 PM
Subject: [boost] limited form of type deduction
> << cross-posted to clc++m in reply to http://tinyurl.com/ofj3 >>
> Problem: Without typeof, what is the result type of the expressions
> (x + y), (x += y), (c ? x : y), (++x), (x++), etc. ?
> Jaakko Jarvi and I are working on the Boost Lambda Library
> (http://www.boost.org/libs/lambda/doc/index.html) and Phoenix
> merger (http://www.boost.org/libs/spirit/phoenix/index.html).
> Hopefully that will happen sometime in the near future. In an attempt
> to do a better type deduction mechanism than what's provided in LL
> (and Phoenix), I experimented with this idea:
> (see [ http://tinyurl.com/ofqf ] )
> In many cases, the result type of a binary expression is related to one of
> its operands. The limited form of type deduction presented can detect
> common relations if the result of a binary or unary operation, given
> x and y with types X and Y (respectively), is X, Y, X&, Y&, X*, Y*, X
> const*, Y const*, bool, int, unsigned, double, container and iterator
> elements (e.g the T, where X is: T[N], T*, vector<T>, map<T>,
> vector<T>::iterator). More arguments/return type relationships can be
> established if needed.
> The (fully commented) code is just a prototype. The final version is
> different (some tweaks and bug-fixes here and there). Email me if you wish
> to see the latest code.
> Joel de Guzman
> Unsubscribe & other changes: