2014-07-24 5 views
1

이 코드는 부스트 정신 libs와의 예에서, 그것은 OK입니다 :부스트 성령 피닉스 기능 오류

on_error<fail>(expr,error_handler_function(eh)("expecting ", _4, _3, _1)); 

오류 메시지 : 그러나

on_error<fail>(expr,error_handler_function(eh)("expecting ", _4, _3)); 

는,이 코드는 엑스 코드로 컴파일하는 데 실패했습니다 :

/usr/local/include/boost/spirit/home/phoenix/core/detail/function_eval.hpp:115:30: 
    error: too many template arguments for class template 'result' 

    fn::template result<BOOST_PP_ENUM_PARAMS(N, a)> 
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

eh(error_handle) 맞아, 나는에 대한 인수를 추가 210.

+0

를 사용하여 제한의 일부를 제거 할 수 있습니다 그것! 오류에 필수적입니다 (그리고 분명히 맞지 않습니다.) – sehe

답변

2

인수를 추가했지만 템플릿 인수를 추가하지 못했습니다.

Phoenix가 완전한 다형성 Functor를 기대하기 때문에 템플릿 인수 여야합니다.


잠재적으로 (컴파일러와 라이브러리 버전에 따라 다름), 당신은 쇼 "`권리 인`어 (error_handle)"뿐만 아니라 _claim_를 수행

#define BOOST_SPIRIT_USE_PHOENIX_V3 
// and/or 
#define BOOST_RESULT_OF_USE_DECLTYPE 
관련 문제