
template<typename T> class a_rule_parser_template : boost::spirit::parser< a_rule_parser_template<T> > { T a_placeholder;
struct __rule { // hide the placeholder member variable of the outer class with a static // variable of the same type static T & a_placeholder;
typedef BOOST_TYPEOF_TPL( an_expression ) type; Line 77 ^^ Typeof acts like a black hole in this context; the "laws of C++ physics" seem not to apply any longer. There should be absolutely no reason for deduction to fail
Forgot something... Tobias Schwinger wrote: like this: test.cpp(77) : error C2784: 'boost::spirit::positive<S> boost::spirit::operator +(const boost::spirit::parser<DerivedT> &)' : could not deduce template argument for 'const boost::spirit::parser<DerivedT> &' from 'T' e:\Libs\Boost\MainCVS2\boost/spirit/core/composite/positive.hpp(93) : see declaration of 'boost::spirit::operator +' test.cpp(72) : see reference to class template instantiation 'a_rule_parser_template<T>::__rule' being compiled test.cpp(89) : see reference to class template instantiation 'a_rule_parser_template<T>' being compiled test.cpp(77) : error C2675: unary '+' : 'T' does not define this operator or a conversion to a type acceptable to the predefined operator test.cpp(77) : error C2784: 'boost::spirit::positive<S> boost::spirit::operator +(const boost::spirit::parser<DerivedT> &)' : could not deduce template argument for 'const boost::spirit::parser<DerivedT> &' from 'T' e:\Libs\Boost\MainCVS2\boost/spirit/core/composite/positive.hpp(93) : see declaration of 'boost::spirit::operator +' test.cpp(77) : error C2675: unary '+' : 'T' does not define this operator or a conversion to a type acceptable to the predefined operator test.cpp(77) : error C2784: 'boost::spirit::positive<S> boost::spirit::operator +(const boost::spirit::parser<DerivedT> &)' : could not deduce template argument for 'const boost::spirit::parser<DerivedT> &' from 'T' e:\Libs\Boost\MainCVS2\boost/spirit/core/composite/positive.hpp(93) : see declaration of 'boost::spirit::operator +' [...] last two messages repeat several times -- Tobias