[haiku-development] BString on GCC4

Hi,

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

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

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


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?

Regards,

Rene

Other related posts: