Boost logo

Boost Users :

From: Arjun Bijanki (arjunb_at_[hidden])
Date: 2003-05-07 21:57:01


> From: Randy Bowen [mailto:rbowen_at_[hidden]]
> Sent: Wednesday, May 07, 2003 5:46 PM
> To: Boost-Users_at_[hidden]
> Subject: [Boost-Users] call_traits and MSVC 7.1
>
> We have been using call_traits from Boost version 1.29.0 in
> conjunction with MSVC 7.0. When attempting to recompile this code
> under MSVC 7.1, using either Boost 1.29.0 or 1.30.0, we now
> encounter compilation errors. A simple example of the usage pattern
> is:

<code snipped>

This is illegal code. That it compiled in MSVC 7.0 was a bug. The
template parameter '_Source' can not be deduced from the callsite of
doSomething. 14.8.2.4 in the ISO/IEC 14882 lists the forms in which
template parameters can be deduced, but a qualified name involving
nested types is not one of them. I suspect it's because of something
like this:

template<typename T> struct S { typedef T type; };
template<> struct S<char> { typedef int type; };

template<typename T> void foo(typename S<T>::type);

int main()
{
    foo(3); //what is T deduced to be?
}

I'd guess the documentation for call_traits discusses typical usage
patterns, and may help. You can also explicitly specify the template
argument.

Hope this helps.

Arjun Bijanki
Microsoft Visual C++


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