Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-10-12 08:15:33


"Karl Meerbergen" <Karl.Meerbergen_at_[hidden]> wrote

> typedef BOOST_TYPEOF_TPL( T1()+T2() ) type;
>
> When I use __typeof__, I get the message: The text "+" is unexpected.

I think it may be confusing a temporary object T1() with a function type --
__typeof__ usually handles both. As a wild guess, you can try to do
something like:

template<class T> T make();

typedef __typeof__(make<T1>()+make<T2>()) type;

> When I do not define BOOST_TYPEOF_NATIVE, all works fine for integral
> and float and double types.

That means you can handle any custom class (after the registration). So the
problem is only related to template registration, which makes it a little
easier...

Regards,
Arkadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net