Re: [Boost-bugs] [Boost C++ Libraries] #6596: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6596: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-23 21:18:49


#6596: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html
----------------------------------------------------+-----------------------
  Reporter: Michael J Smith <emmenjay@…> | Owner: marshall
      Type: Bugs | Status: assigned
 Milestone: Boost 1.50.0 | Component: algorithm
   Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords: docs typo clarity
----------------------------------------------------+-----------------------

Comment (by Michael J Smith <emmenjay@…>):

 Replying to [comment:2 marshall]:
> Thanks for the bug report.
>
> At first I really liked your suggestion, but when I looked more closely,
 I noticed that both `find_head` and `find_tail` can take negative length
 parameters (`N`) which mean return `length(input)+N` , so I think that the
 statement "If 'input' is less than 'N' elements long" is not correct.
>
> I checked in the minimal change (if/is), and will think about a better
 way to word this.



 Oops. Post in haste, repent at leisure.

 How about this:

 For 'N' >= 0: Get the first 'N' elements of the input range. If 'N' is
 greater than the length of the input range, return the whole input range.

 For 'N' < 0: Get the first size(input) + 'N' elements.

 e.g.

 {{{
     string s = "Algorithm";
     FindHead(s, 3); // returns "Alg"
     FindHead(s, 42); // returns "Algorithm"
     FindHead(s, -3); // returns "Algori"
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6596#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC