22 Oct
2008
22 Oct
'08
9:28 p.m.
AMDG 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. If you have a different multiply_traits for every type, then it is completely useless in generic code. In Christ, Steven Watanabe