Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65793 - in trunk: boost/proto libs/proto/test
From: eric_at_[hidden]
Date: 2010-10-06 18:13:28


Author: eric_niebler
Date: 2010-10-06 18:13:27 EDT (Wed, 06 Oct 2010)
New Revision: 65793
URL: http://svn.boost.org/trac/boost/changeset/65793

Log:
knock down value of proto::N, fixed #4602
Text files modified:
   trunk/boost/proto/proto_fwd.hpp | 7 +++++++
   trunk/libs/proto/test/matches.cpp | 8 ++++++++
   2 files changed, 15 insertions(+), 0 deletions(-)

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2010-10-06 18:13:27 EDT (Wed, 06 Oct 2010)
@@ -337,7 +337,14 @@
     template<typename Grammar>
     struct vararg;
 
+ // Work around for MSVC-10 bug
+ // https://connect.microsoft.com/VisualStudio/feedback/details/611139/visual-c-cannot-create-a-typedef-to-an-array-of-non-char-with-more-than-0x7fffffff-elements
+ // Boost bug https://svn.boost.org/trac/boost/ticket/4602
+ #if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
+ int const N = (INT_MAX >> 10);
+ #else
     int const N = INT_MAX;
+ #endif
 
     namespace context
     {

Modified: trunk/libs/proto/test/matches.cpp
==============================================================================
--- trunk/libs/proto/test/matches.cpp (original)
+++ trunk/libs/proto/test/matches.cpp 2010-10-06 18:13:27 EDT (Wed, 06 Oct 2010)
@@ -165,6 +165,14 @@
     assert_matches< terminal<char [N]> >( as_child("hello") );
     assert_matches< terminal<char [N]> >( as_expr("hello") );
 
+ assert_matches< terminal<wchar_t const[N]> >( lit(L"hello") );
+ assert_matches< terminal<wchar_t const (&)[N]> >( as_child(L"hello") );
+ assert_matches< terminal<wchar_t const[N]> >( as_expr(L"hello") );
+
+ assert_matches< terminal<wchar_t [N]> >( lit(L"hello") );
+ assert_matches< terminal<wchar_t [N]> >( as_child(L"hello") );
+ assert_matches< terminal<wchar_t [N]> >( as_expr(L"hello") );
+
     assert_matches_not< if_<is_same<_value, int>()> >( lit("hello") );
 
     assert_matches< terminal<std::string> >( lit(std::string("hello")) );


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