Boost logo

Boost Users :

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-10-12 02:02:13


Arkadiy Vertleyb wrote:

>"Karl Meerbergen" <Karl.Meerbergen_at_[hidden]> wrote
>
>
>
>>When BOOST_TYPEOF_NATIVE is defined, the following code does not
>>compile, and this is precisely what I want to do.
>>
>>
>
>
>
>>template <class T1, class T2>
>>struct my_struct {
>> typedef BOOST_TYPEOF_TPL( T1()+T2() ) type;
>>};
>>
>>
>
>What is the error message? Do you have the same problem if you use
>__typeof__ directly?
>

typeofsample.cpp", line 5.3: 1540-0132 (S) The expression must be a
constant expression.

Line 5 is:

 typedef BOOST_TYPEOF_TPL( T1()+T2() ) type;

When I use __typeof__, I get the message: The text "+" is unexpected.

When I do not define BOOST_TYPEOF_NATIVE, all works fine for integral
and float and double types. It is a good basis to start for me, but I
would have hoped to be able to get further. Thanks for your help.

Karl


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