[haiku-development] BString on GCC4

  • From: "Rene Gollent" <anevilyak@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 19 Apr 2008 19:40:28 -0500


I'm curious, what's the point of this:

        // Unchecked char access
        char            operator[](int32 index) const;

#if __GNUC__ > 3
        BStringRef  operator[](int32 index);
        char&           operator[](int32 index);

the BStringRef version seems to hide the others for me in practical
use, as something like: printf("%c", str[i]); now results in a warning
on gcc4 specifying: "Cannot pass non-POD type BStringRef through ...,
call will abort at runtime." Also, why both a char and char& version
of the same operator?



Other related posts: