Sorry for the additional post; I should have added this to my preceding
message.
I just want to clarify: I am trying to be very careful to distinguish
between implementation and semantics.
If my understanding is correct, AnsiString implementation is always
pass-by-reference.
The problem is
On 7/10/2011 2:40 PM, Daniƫl Mantione wrote:
However, for a new calling convention (on an existing or a new
platform) it's completely up to the compiler designer what will be
passed as const and what will be passed as reference.
Agreed. That's why I say you can't really make assumptions: if you
Some thoughts on the meaning of const, constref, and "constval", and how
they can usefully be applied:
My initial understanding of const was hazy. I have come to appreciate
that it is defined, but only in a very loose way. Instead of undefined I
should say ill-defined. I'm not entirely sure what
Wow, thanks for the insults guys. I didn't realize I was so stupid.
You missed my point too, BTW. According to the link given:
"A constant argument is passed by reference if its size is larger than a
pointer."
So you always know what the size of a pointer is? If I have this record:
TMyRec =
Martin wrote:
- See difference to normal "const" is " that it must be passed by
reference."
I had not read about it before, but I think constref is a huge step in
the right direction. It eliminates my fundamental grief with the current
implementation.
Specifically, the way const is now "def
I have just written up some very compelling arguments and then decided
to scrap it.
I maintain that const strings, dynamic arrays, and interfaces, as
currently implemented, are dangerous and should be considered useless in
all but the most limited circumstances. The behavior is dependent upon
I have some observations on the discussion so far. The biggest question
is what the intended behavior is.
Martin wrote:
Well, I have pointed out myself,in my mail, that it probably needs
more documentation. I do not know if it is documented or not.
But it is the answer, I have gotten several t
Max wrote:
It's subjective on my side, but If it existed so many years in
borland/inprise/embarcadero products and I can not remember my own
bug fixes related to something like this, I consider your example
more artificial than one might think.
I understand what you're saying, and I had the sam
I've been reading over some of the recent discussion about reference
counting problems with const string parameters. I've done some
experiments and I believe that the so-called const optimization is a
serious flaw, not just a corner case of questionable legitimacy. I have
some sample code I will s
e are probably a dozen distinct bugs, but many overlap. Please
advise me on how things are done here. Thanks.
Chad Berchek
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
10 matches
Mail list logo