새로운 0X 표준을 사용하여 <ints, vector<ints> >
의지도를 초기화하려고했지만 올바른 구문을 얻지 못하는 것 같습니다. = 값 1 : 나는 키 단일 항목으로지도를하고 싶습니다 < 3,4>벡터지도에서 initializer_list 사용
#include <initializer_list>
#include <map>
#include <vector>
using namespace std;
map<int, vector<int> > A = {1,{3,4}};
....
:
error: no matching function for call to std::map<int,std::vector<int,std::allocator<int> >,std::less<int>,std::allocator<std::pair<const int,std::vector<int,std::allocator<int> > > > >::map(<brace-enclosed initializer list>)
편집
맞물림 톱니에 의해 제안을 다음과 이제 -fno-를 추론-초기화리스트 플래그를 사용하여 제거 입수 할 수있는 경고와 함께 컴파일 여분의 중괄호를 추가. 그렇게하는 데 위험이 있습니까?
중괄호가 빠져 있지 않습니까? – YGL
@ YGL - 고맙습니다. 그래도 원래의 문제는 해결되지 않습니다. – Hooked
4.4.1에서 컴파일러는 신경 쇠약 (내부 오류)을 겪습니다. 어쩌면 4.5와 제대로 작동합니까? – ergosys