[Boost-bugs] [Boost C++ Libraries] #6540: Erroneous default argument in basic_string::compare overload

Subject: [Boost-bugs] [Boost C++ Libraries] #6540: Erroneous default argument in basic_string::compare overload
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-10 01:19:21


#6540: Erroneous default argument in basic_string::compare overload
------------------------------------------------+---------------------------
 Reporter: Erik Jensen <Erik.Jensen@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 basic_string in string.hpp contains the following definition:
 {{{
 int compare(size_type pos1, size_type n1, const CharT* s, size_type n2 =
 npos) const {...}
 }}}
 However, n2 should not have a default argument. It interferes with calling
 "int compare(size_type pos1, size_type n1, const CharT* s) const", and a
 value of npos makes no sense for n2 anyway (it would mean the passed c
 string had "infinite" length).

 Thank you,
 Erik Jensen

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6540>
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