Topic: basic_string::compare() function


Author: Martin Sebor <sebor@roguewave.com>
Date: Mon, 19 Mar 2001 18:18:47 GMT
Raw View
Albrecht Fritzsche wrote:
>
> Hi,
>
> while trying to emulate the string interface (for a fast effective
> string implementation without MT support ...) I found the following
> member function in the Standard 21.3.6.8/6
>
>   int compare(size_type pos, size_type n1,
>               charT* s,                      // !!!!!!!!!!!!
>               size_type n2=npos) const;
>
> Why is the third parameter non-const? The libs I had a look at
> (STLport, Rogue Wave) have the third parameter as a const one.
>
> Was there a change in the Standard - and where can I found those
> changes, corrections, etc.. (I own only the downloadable .pdf copy)

Yes -- library issue 5 corrects the signature. See
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#5.

Regards
Martin

>
> THanks for any help
> Ali
> --
> Albrecht Fritzsche, Software Developer
> alfabet meta-modeling AG,
> leibnizstr. 53, 10629 berlin, germany
> http://www.alfabet.de
>
> ---
> [ comp.std.c++ is moderated.  To submit articles, try just posting with ]
> [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
> [              --- Please see the FAQ before posting. ---               ]
> [ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]





Author: Albrecht Fritzsche <albrecht.fritzsche@alfabet.de>
Date: Mon, 12 Mar 2001 14:12:33 GMT
Raw View
Hi,

while trying to emulate the string interface (for a fast effective
string implementation without MT support ...) I found the following
member function in the Standard 21.3.6.8/6

  int compare(size_type pos, size_type n1,
              charT* s,                      // !!!!!!!!!!!!
              size_type n2=npos) const;

Why is the third parameter non-const? The libs I had a look at
(STLport, Rogue Wave) have the third parameter as a const one.

Was there a change in the Standard - and where can I found those
changes, corrections, etc.. (I own only the downloadable .pdf copy)

THanks for any help
Ali
--
Albrecht Fritzsche, Software Developer
alfabet meta-modeling AG,
leibnizstr. 53, 10629 berlin, germany
http://www.alfabet.de

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]