[Boost-bugs] [Boost C++ Libraries] #7364: ambiguity error constructing std::vector from assign::list_of

Subject: [Boost-bugs] [Boost C++ Libraries] #7364: ambiguity error constructing std::vector from assign::list_of
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-11 04:01:50


#7364: ambiguity error constructing std::vector from assign::list_of
-------------------------------------+--------------------------------------
 Reporter: eric_niebler | Owner: nesotto
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: assign
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 The problem is due to the addition of rvalue-reference container
 constructors. The following fails to compile with vc10:

 {{{
 #include <vector>
 #include <boost/assign/list_of.hpp>

 int main()
 {
     std::vector<int> i(boost::assign::list_of(1));
 }
 }}}

 The error is:

 {{{
 1>c:\boost\org\trunk\libs\proto\scratch\main.cpp(6): error C2668:
 'std::vector<_Ty>::vector' : ambiguous call to overloaded function
 1> with
 1> [
 1> _Ty=int
 1> ]
 1> c:\program files (x86)\microsoft visual studio
 10.0\vc\include\vector(593): could be
 'std::vector<_Ty>::vector(std::vector<_Ty> &&)'
 1> with
 1> [
 1> _Ty=int
 1> ]
 1> c:\program files (x86)\microsoft visual studio
 10.0\vc\include\vector(515): or 'std::vector<_Ty>::vector(unsigned
 int)'
 1> with
 1> [
 1> _Ty=int
 1> ]
 1> while trying to match the argument list
 '(boost::assign_detail::generic_list<T>)'
 1> with
 1> [
 1> T=int
 1> ]
 1>
 1>Build FAILED.
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7364>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC