Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86171 - trunk/libs/algorithm/doc
From: marshall_at_[hidden]
Date: 2013-10-05 21:24:42


Author: marshall
Date: 2013-10-05 21:24:41 EDT (Sat, 05 Oct 2013)
New Revision: 86171
URL: http://svn.boost.org/trac/boost/changeset/86171

Log:
Fixed typo in documentation for equal and mismatch; thanks to Larry for the catch

Text files modified:
   trunk/libs/algorithm/doc/equal.qbk | 2 +-
   trunk/libs/algorithm/doc/mismatch.qbk | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/libs/algorithm/doc/equal.qbk
==============================================================================
--- trunk/libs/algorithm/doc/equal.qbk Sat Oct 5 19:09:23 2013 (r86170)
+++ trunk/libs/algorithm/doc/equal.qbk 2013-10-05 21:24:41 EDT (Sat, 05 Oct 2013) (r86171)
@@ -22,7 +22,7 @@
         
         std::equal ( seq1.begin (), seq1.end (), seq2.begin ()); // true
         std::equal ( seq2.begin (), seq2.end (), seq1.begin ()); // Undefined behavior
- std::equal ( seq1.begin (), seq1.end (), seq1.begin (), seq2.end ()); // false
+ std::equal ( seq1.begin (), seq1.end (), seq2.begin (), seq2.end ()); // false
 ```
 
 You can argue that `true` is the correct answer in the first case, even though the sequences are not the same. The first N entries in `seq2` are the same as the entries in `seq1` - but that's not all that's in `seq2`. But in the second case, the algorithm will read past the end of `seq1`, resulting in undefined behavior (large earthquake, incorrect results, pregnant cat, etc).

Modified: trunk/libs/algorithm/doc/mismatch.qbk
==============================================================================
--- trunk/libs/algorithm/doc/mismatch.qbk Sat Oct 5 19:09:23 2013 (r86170)
+++ trunk/libs/algorithm/doc/mismatch.qbk 2013-10-05 21:24:41 EDT (Sat, 05 Oct 2013) (r86171)
@@ -22,7 +22,7 @@
         
         std::mismatch ( seq1.begin (), seq1.end (), seq2.begin ()); // <3, 3>
         std::mismatch ( seq2.begin (), seq2.end (), seq1.begin ()); // Undefined behavior
- std::mismatch ( seq1.begin (), seq1.end (), seq1.begin (), seq2.end ()); // <3, 3>
+ std::mismatch ( seq1.begin (), seq1.end (), seq2.begin (), seq2.end ()); // <3, 3>
 ```
 
 The first N entries in `seq2` are the same as the entries in `seq1` - but that's not all that's in `seq2`. In the second case, the algorithm will read past the end of `seq1`, resulting in undefined behavior (large earthquake, incorrect results, pregnant cat, etc).


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