[haiku-bugs] Re: [Haiku] #7948: Bogus prototype for string::compare

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Sun, 28 Aug 2011 08:52:52 -0000

#7948: Bogus prototype for string::compare
--------------------------+----------------------------
   Reporter:  pulkomandy  |      Owner:  nobody
       Type:  bug         |     Status:  new
   Priority:  normal      |  Milestone:  R1
  Component:  System      |    Version:  R1/Development
 Resolution:              |   Keywords:
 Blocked By:              |   Blocking:
Has a Patch:  0           |   Platform:  All
--------------------------+----------------------------
Description changed by pulkomandy:

Old description:

> I noticed the C++ standard has :
> {{{
> int String::compare(size_t pos1, size_t n1, const char* s) const;
> }}}
>
> While Haiku std/bastring.h declares :
> {{{
> int compare(const char* s, size_t pos1, size_t n1) const;
> }}}
>
> Not sure if this is BeOS legacy, but it's a bit annoying when trying to
> write portable C++ code.

New description:

 I noticed the C++ standard has :
 {{{
 int String::compare(size_t pos1, size_t n1, const char* s) const;
 }}}

 While Haiku std/bastring.h declares :
 {{{
 int compare(const char* s, size_t pos1, size_t n1) const;
 }}}
 It is BeOS "legacy" (ie BeOS has the same problem), but it's a bit
 annoying when trying to write portable C++ code.

 Can we do something about it without breaking binary compatibility ?

--

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7948#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: