Boost logo

Boost Users :

Subject: Re: [Boost-users] Can not compile a program that uses typeof package by gcc?
From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2008-10-22 19:24:10

On Wed, Oct 22, 2008 at 4:28 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> Peng Yu wrote:
>> I'm confused. You agreed above that multiply_traits shall be defined
>> in B::detail. Down below, you said that it's better not to put user
>> defined code in B::detail, while multiply_traits corresponding to X1,
>> X2,..., are user defined code.
>> Then where do I need to put multiply_traits?
> What I meant to say was that if library B contains a function
> that needs to deduce the result type of a multiplication, then
> it should put a typeof based multiply_traits in B::detail.
> It doesn't matter what X1, X2, etc are because Boost.Typeof
> handles the actual deduction.

BOOST_TYPEOF does not work with the current version of GCC, the
compiler that I use. That is why I have to use multiply_traits. Then
where I put multiply_traits?

> If you have a different multiply_traits for every type, then
> it is completely useless in generic code.

I don't quite understand what you mean. Since users have their choice
to define whatever classes to be used of B::Y, they have to have a way
to define multiply_traits if they want. I don't understand why "it is
completely useless in generic code". What you mean by generic code?

Essentially, I want see if there is a solution or a walkaround to the
question posted at

Would you please read it if my original question was not quite clear to you?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at