|
Boost Users : |
From: Randy Bowen (rbowen_at_[hidden])
Date: 2003-05-07 19:45:53
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:
###############################################################
#include <boost/call_traits.hpp>
class A
{
public:
template<typename _Source>
void doSomething
(
typename boost::call_traits<_Source>::param_type value
)
{
}
};
class B
{
public:
explicit B(double d = 1.0, int i = 42) : _d(d), _i(i) {}
B(B const& b) : _d(b._d), _i(b._i) {}
private:
double _d;
int _i;
};
extern "C" int main(int argc, char* argv[])
{
A a;
B b;
a.doSomething(b);
return 0;
}
#############################################################
The new compiler generates the error message:
c:\Documents and Settings\rbowen\My
Documents\Projects\CallTraitsTest\CallTraitsTest.cpp(34) : error
C2783: 'void A::doSomething
(boost::call_traits<_Source>::param_type)' : could not deduce
template argument for '_Source'
c:\Documents and Settings\rbowen\My
Documents\Projects\CallTraitsTest\CallTraitsTest.cpp(11) : see
declaration of 'A::doSomething'
As an experiment, I manually included the older logic for
call_traits by cutting and pasting the relevant classes into my
source from 'detail/ob_call_traits.hpp' and still encountered the
same error.
Has anyone else experienced this? Is this (yet another) MS compiler
bug?
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