Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-10-16 13:15:44


Author: eric_niebler
Date: 2007-10-16 13:15:44 EDT (Tue, 16 Oct 2007)
New Revision: 40091
URL: http://svn.boost.org/trac/boost/changeset/40091

Log:
cleanup
Text files modified:
   trunk/libs/xpressive/test/test_assert.cpp | 20 ++++----------------
   1 files changed, 4 insertions(+), 16 deletions(-)

Modified: trunk/libs/xpressive/test/test_assert.cpp
==============================================================================
--- trunk/libs/xpressive/test/test_assert.cpp (original)
+++ trunk/libs/xpressive/test/test_assert.cpp 2007-10-16 13:15:44 EDT (Tue, 16 Oct 2007)
@@ -12,13 +12,10 @@
 
 using namespace boost::xpressive;
 
-struct three_or_six
+bool three_or_six(ssub_match const &sub)
 {
- bool operator()(ssub_match const &sub) const
- {
- return sub.length() == 3 || sub.length() == 6;
- }
-};
+ return sub.length() == 3 || sub.length() == 6;
+}
 
 ///////////////////////////////////////////////////////////////////////////////
 // test1
@@ -27,7 +24,7 @@
 {
     std::string str("foo barbaz fink");
     // match words of 3 characters or 6 characters.
- sregex rx = (bow >> +_w >> eow)[ check(three_or_six()) ] ;
+ sregex rx = (bow >> +_w >> eow)[ check(&three_or_six) ] ;
 
     sregex_iterator first(str.begin(), str.end(), rx), last;
     BOOST_CHECK_EQUAL(std::distance(first, last), 2);
@@ -46,15 +43,6 @@
     BOOST_CHECK_EQUAL(std::distance(first, last), 2);
 }
 
-struct days_per_month_type
-{
- int operator[](int i) const
- {
- std::cout << "HERE " << i << std::endl;
- return 29;
- }
-};
-
 ///////////////////////////////////////////////////////////////////////////////
 // test3
 // more complicated use of custom assertions to validate a date


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