본문 바로가기
[ ★ ]Study/Programming

error: ‘>>’ should be ‘> >’ within a nested template argument list

by nroses-taek 2018. 2. 12.

error: ‘>>’ should be ‘> >’ within a nested template argument list



example :


queue<pair<int, int>> q;


“>>”이 연속된 ‘>’으로 인식되는 것이 아니라 구문 분석 시작 전 어휘 분석 단계에서 최대 흡수규칙에 따라 “>>” 토큰으로 인식되고 이는 다시 문법 단계에서 “>>” 연산자로 인식된다.



solution :


queue<pair<int, int> > q;

 >> 사이에 한 칸의 공백을 준다.


컴파일 할 때 C++11을 사용한다.

댓글