
On Mon, Oct 20, 2008 at 11:57 AM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Peng Yu wrote:
I'm not sure if I understand you correctly. But I got the following code which still ends up with the compiler bug. Would you please give me a complete working copy of the program so that I can play with it?
attached.
Hi, In line 51-55 of you attached file, it says the following. template <typename T1, typename T2> Y<typename A::multiply_traits<T1, T2>::result_type> operator*(const Y<T1> &y, const T2 &t) { return Y<T1>(y.the_t() * t); } This way requires that I have to explicitly say 'multiply_traits' is from the namespace A. I wanted to use the following instead, which does not need to specify which the namespaces T1 and T2 are. But the following code still results in the compiler error. template <typename T1, typename T2> Y<BOOST_TYPEOF(T1() * T2())> operator*(const Y<T1> &y, const T2 &t) { return Y<T1>(y.the_t() * t); } My question is not resolved. I'm attaching the source file with some comments to avoid any confusion. Would you please take another look at the problem? Thanks, Peng