[openbeos] Re: Pointer or reference?

  • From: "anqe" <a_nqe@xxxxxxxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Sun, 28 Mar 2004 11:46:05 +0100

> I mean that we could just define this in our style-guidelines. If I
> pass the pointer to my string I expect evil things to happen, but if I
> pass the string object I do not know whether it is a reference or just
> a copy, so I do not expect changes being made to my string.

Thats probably being overly cautious, the compiler is always going to
protect constant values as read only so providing that your interacting with
other C++ the compiler is not going to allow anything nasty to happen to the
string your laying bare.

The only time I could see this being an issue is if your passing the string
over to assembly, but if thats the case the assembly should have been
written defensivly to avoid such issues.

bye

Other related posts: