Boost logo

Boost :

From: Peder Holt (peder.holt_at_[hidden])
Date: 2004-08-27 14:41:46


<snip>

> But there are two ways of using functions to implement typeof:
> 1: Create functions that returns the encoded size of element #N in the
> expression
> This is what I have currently done, and VC chokes on it, as it
> recurses too deeply.
> 2: Create functions that return the type of element #N, and then
> encode this type.
> This requires that all the recursion be done in the typeof macro.
> To get the type of element #3 you would have to do something like:
> encode(foo(foo(foo(make_foo(expression))));
> It seems VC likes that better. I'll try to follow that approach.

It turns out that this was the correct approach. VC does not complain,
and the source gets much more compact and simple. In addition, this
solution automatically solves the problem with base/derived class
registration, as I rely on functions returning function pointers.

<snip>

--
Peder Holt

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