id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7367,Ambiguity with nested list_of on C++11/C++0x compilers,zadirion@…,Thorsten Ottosen,"The following code compiles in VS2010, however when compiled with VS2012 or GCC 4.7.1 it no longer compiles. {{{ #include ""stdafx.h"" #include #include #include using namespace std; typedef wstring IssueInfo; typedef vector IssuesAndFixes; typedef pair IssueCategoryEntry; typedef vector IssuesAndFixesMap; extern const IssuesAndFixesMap kIssuesAndFixes; IssuesAndFixes dummy; const IssuesAndFixesMap kIssuesAndFixes = boost::assign::list_of ( wstring(), boost::assign::list_of ( ) ); int main() { return 0; } }}} Error in GCC is: {{{ Compilation finished with errors: In file included from include/c++/4.7.1/bits/stl_algobase.h:65:0, from include/c++/4.7.1/bits/char_traits.h:41, from include/c++/4.7.1/string:42, from source.cpp:1: include/c++/4.7.1/bits/stl_pair.h: In instantiation of 'constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) [with _U2 = const boost::assign_detail::generic_list >&; = void; _T1 = std::basic_string; _T2 = std::vector >]': boost/preprocessor/iteration/detail/local.hpp:37:1: required from 'boost::assign_detail::generic_list& boost::assign_detail::generic_list::operator()(const U&, const U0&) [with U = std::basic_string; U0 = boost::assign_detail::generic_list >; T = std::pair, std::vector > >; boost::assign_detail::generic_list = boost::assign_detail::generic_list, std::vector > > >]' boost/preprocessor/iteration/detail/local.hpp:37:1: required from 'boost::assign_detail::generic_list boost::assign::list_of(const U&, const U0&) [with T = std::pair, std::vector > >; U = std::basic_string; U0 = boost::assign_detail::generic_list >]' source.cpp:25:3: required from here include/c++/4.7.1/bits/stl_pair.h:137:45: error: call of overloaded 'vector(const boost::assign_detail::generic_list >&)' is ambiguous include/c++/4.7.1/bits/stl_pair.h:137:45: note: candidates are: In file included from include/c++/4.7.1/vector:65:0, from source.cpp:2: include/c++/4.7.1/bits/stl_vector.h:361:7: note: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::basic_string; _Alloc = std::allocator >; std::vector<_Tp, _Alloc>::allocator_type = std::allocator >] include/c++/4.7.1/bits/stl_vector.h:324:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::basic_string; _Alloc = std::allocator >; std::vector<_Tp, _Alloc> = std::vector >] include/c++/4.7.1/bits/stl_vector.h:307:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::basic_string; _Alloc = std::allocator >; std::vector<_Tp, _Alloc> = std::vector >] include/c++/4.7.1/bits/stl_vector.h:266:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::basic_string; _Alloc = std::allocator >; std::vector<_Tp, _Alloc>::size_type = unsigned int] include/c++/4.7.1/bits/stl_vector.h:254:7: note: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::basic_string; _Alloc = std::allocator >; std::vector<_Tp, _Alloc>::allocator_type = std::allocator >] }}} Adding a '''to_container(dummy)''' call on the second list_of fixes the issue though. Example: liveworkspace.org/code/38e5fafed72adf0730ad71ebb599c97e",Bugs,closed,To Be Determined,assign,Boost 1.52.0,Regression,duplicate,,victor.ciura@…