Visual C++ 2005 error C2666 with variants.
I have spent a couple of hours trying to resolve the following error when
building our system. We have some code that has been compiling and working
with GCC with no issues. However building it with MS VC20005 SP1 creates the
following error. We are using boost 1.34.1:
Error 2 error C2666:
'boost::variant
AMDG Bill McLean wrote:
I have spent a couple of hours trying to resolve the following error when building our system. We have some code that has been compiling and working with GCC with no issues. However building it with MS VC20005 SP1 creates the following error. We are using boost 1.34.1:
Error 2 error C2666: 'boost::variant
::convert_construct' : 2 overloads have similar conversions c:\projects\ardev\currentdev\externallibs\boost\boost\variant\variant.hpp 1342 I have searched the Boost list archives and found this post for boost 1.33.1:
http://lists.boost.org/Archives/boost/2006/03/102375.php
The author of this post Peter Schreegle did not receive a reply. He attached the below code and build log. It appears that this an issue for variants under visual studio 2005 SP1. Does anyone know if this is an issue for VS 2008? Is this issue for boost 1.35.0 being built by VS 2005 or VS 2008?
Aaargh. This is a compiler bug. msvc generates incorrect copy constructors and assignment operators in the presence of a base class with a templated constructor/assignment operator. If you create a copy constructor and assignment operator yourself, it ought to work. In Christ, Steven Watanabe
participants (2)
-
Bill McLean
-
Steven Watanabe