Boost logo

Boost :

Subject: [boost] [proto][1.43] Problem with proto::matches
From: Antoine de Maricourt (antoine.de-maricourt_at_[hidden])
Date: 2010-08-04 16:44:47


Hi Eric,

I went into the following error with a grammar using terminals of T[N]
(terminal<int[2]> in the example, gcc 4.5.0, boost 1.43):

/usr/local/include/boost/proto/matches.hpp:1026:13: error: ambiguous
class template instantiation for struct
boost::proto::detail::lambda_matches<int [2],
boost::proto::wildcardns_::_, -0x00000000000000001l>
/usr/local/include/boost/proto/matches.hpp:119:13: error: candidates
are: struct boost::proto::detail::lambda_matches<T,
boost::proto::wildcardns_::_, -0x00000000000000001l>
/usr/local/include/boost/proto/matches.hpp:129:13:
error: struct boost::proto::detail::lambda_matches<T
[M], U, -0x00000000000000001l>

Adding the following specialization in matches.hpp solves it:

template<typename T, std::size_t M>
struct lambda_matches<T[M], proto::_ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
   : mpl::true_ {};

Best regards,

     Antoine


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk