Opened 9 years ago

Last modified 9 years ago

#9367 new Bugs

Minor typo in Boost.Algorithm

Reported by: oss.2012.team+2013C@… Owned by: Marshall Clow
Milestone: To Be Determined Component: algorithm
Version: Boost Development Trunk Severity: Cosmetic
Keywords: Cc:

Description

Patch attached for fixing it.

Additional comments:

In ordered-hpp.qbk, the iterator requirements for is_sorted say

The is_sorted functions will work on all kinds of iterators (except output iterators).

So I think it would be better to use InputIterator rather than Iterator for template parameters:

  • libs/algorithm/doc/ordered-hpp.qbk

     
    1919
    2020``
    2121namespace boost { namespace algorithm {
    22         template <typename Iterator, typename Pred>
    23         bool is_sorted ( Iterator first, Iterator last, Pred p );
     22        template <typename InputIterator, typename Pred>
     23        bool is_sorted ( InputIterator first, InputIterator last, Pred p );
    2424       
    25         template <typename Iterator>
    26         bool is_sorted ( Iterator first, Iterator last );
     25        template <typename InputIterator>
     26        bool is_sorted ( InputIterator first, InputIterator last );
    2727       
    2828       
    2929        template <typename Range, typename Pred>

Ditto for is_decreasing/increasing and is_strictly_decreasing/increasing.

In is_sorted.hpp, the DOXYGEN comments for is_sorted use ForwardIterator. Is that a typo of InputIterator? Ditto for is_decreasing/increasing and is_strictly_decreasing/increasing.

Attachments (1)

algorithm_typo_fix.patch (1.3 KB ) - added by oss.2012.team+2013C@… 9 years ago.
Typo fix for Boost.Algorithm

Download all attachments as: .zip

Change History (4)

by oss.2012.team+2013C@…, 9 years ago

Attachment: algorithm_typo_fix.patch added

Typo fix for Boost.Algorithm

comment:1 by Marshall Clow, 9 years ago

I changed the requirements for is_sorted to use forward iterators or better (instead of input iterators).

This matches the requirements in the C++11 standard. Updated the documentation to reflect this.

comment:2 by Marshall Clow, 9 years ago

(In [86741]) Updated docs for is_sorted, etc. Refs #9367

comment:3 by oss.2012.team+2013C@…, 9 years ago

Thanks for clarifying the doc! FYI, the attached patch fixes pure typos that are not fixed in r86741.

Note: See TracTickets for help on using tickets.