|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64661 - in trunk: boost/proto libs/proto/test
From: eric_at_[hidden]
Date: 2010-08-07 10:44:28
Author: eric_niebler
Date: 2010-08-07 10:44:27 EDT (Sat, 07 Aug 2010)
New Revision: 64661
URL: http://svn.boost.org/trac/boost/changeset/64661
Log:
fix proto::matches bug with lambda_matches, array types and the wildcard
Text files modified:
trunk/boost/proto/matches.hpp | 5 +++++
trunk/libs/proto/test/matches.cpp | 11 +++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
Modified: trunk/boost/proto/matches.hpp
==============================================================================
--- trunk/boost/proto/matches.hpp (original)
+++ trunk/boost/proto/matches.hpp 2010-08-07 10:44:27 EDT (Sat, 07 Aug 2010)
@@ -119,6 +119,11 @@
{};
template<typename T, std::size_t M>
+ struct lambda_matches<T[M], _ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
+
+ template<typename T, std::size_t M>
struct lambda_matches<T[M], T[M] BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
: mpl::true_
{};
Modified: trunk/libs/proto/test/matches.cpp
==============================================================================
--- trunk/libs/proto/test/matches.cpp (original)
+++ trunk/libs/proto/test/matches.cpp 2010-08-07 10:44:27 EDT (Sat, 07 Aug 2010)
@@ -98,6 +98,10 @@
struct my_terminal
{};
+template<typename T>
+struct a_template
+{};
+
void test_matches()
{
assert_matches< _ >( lit(1) );
@@ -263,6 +267,13 @@
assert_matches< proto::and_<proto::terminal<int> > >( lit(1) );
assert_matches< proto::or_<proto::terminal<int> > >( lit(1) );
}
+
+ // Test lambda matches with arrays, a corner case that had
+ // a bug that was reported by Antoine de Maricourt on boost_at_[hidden]
+ {
+ a_template<int[3]> a;
+ assert_matches< proto::terminal< a_template<_> > >( lit(a) );
+ }
}
using namespace unit_test;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk