id summary reporter owner description type status milestone component version severity resolution keywords cc 2839 move-emulated swap causes overloaded ambiguous fun call st@… Antony Polukhin "The attached test file is a minimal example of something I have a real-world use for (with T instead of int), and it doesn't compile in MS Visual Studio 2005 or 2008. The error message is too long as it's templated code, but the head follows: 1>c:\Users\dh\products\avir\include\boost/variant/detail/move.hpp(155) : error C2668: 'boost::detail::variant::detail::move_swap::swap' : ambiguous call to overloaded function 1> c:\Users\dh\products\avir\include\boost/variant/detail/move.hpp(141): could be 'void boost::detail::variant::detail::move_swap::swap(T &,T &)' 1> with 1> [ 1> T=T2 1> ] 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\utility(16): or 'void std::swap(_Ty &,_Ty &)' [found using argument-dependent lookup] 1> with 1> [ 1> T=T2, 1> _Ty=T2 1> ] 1> while trying to match the argument list '(T2 , T2 )' 1> c:\Users\dh\products\avir\include\boost/variant/variant.hpp(684) : see reference to function template instantiation 'void boost::detail::variant::move_swap(T &,T &)' being compiled 1> with 1> [ 1> T=T2 1> ] The crucial code is in variant/detail/move.hpp, from line 114. As my variant includes a std::vector*, it finds std::swap in the unqualified call on line 155. The code in question is protected by a BOOST_WORKAROUND that disables it for gcc. I tested this case on gcc, and it works fine, but fails in the same way if I remove the workaround. The comment above it claims that it falls back for ""non-conforming compilers,"" but I'm not convinced that the expected behaviour is conformant. Basic.lookup.koenig says explicitly that ""If T is a pointer to U or an array of U, its associated namespaces and classes are those associated with U.""" Bugs closed Boost 1.56.0 variant Boost 1.38.0 Problem fixed