$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] [proto][1.43] Problem with proto::matches
From: Eric Niebler (eric_at_[hidden])
Date: 2010-08-06 18:00:46
On 8/4/2010 4:44 PM, Antoine de Maricourt wrote:
> 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_ {};
I can't reproduce this error. The following program compiles just fine
for me on gcc 4.5:
    #include <boost/proto/proto.hpp>
    int main()
    {
        BOOST_MPL_ASSERT((
            boost::proto::matches<
                boost::proto::terminal<int[2]>::type
              , boost::proto::_
            >
        ));
    }
Can you please send a program I can use to reproduce the error?
-- Eric Niebler BoostPro Computing http://www.boostpro.com