Re: class object initialisation
tom_usenet wrote:[color=blue][color=green]
>> Well, in my poor English vocabulary that is non-determinable.
>> Indeterminate is (for me) something we do not know for sure (like
>> what will rand put there) but we can find out later.
>> Non-determinable is OTOH something which cannot be examined.[/color]
>
> Indeterminate:
> a)Not precisely determined, determinable, or established: a person of
> indeterminate age.[/color]
He *has* an age, we just do not know it. It is not like he has no such
thing as an age. While uninitialized PODs may have such bits in their
storage that they have no value whatsoever.
[color=blue]
> b)Not precisely fixed, as to extent, size, nature, or number: an
> indeterminate number of plant species in the jungle.[/color]
So many, we cannot/will not count it. Again: it is an existing, valid
value.
[color=blue]
> c)Lacking clarity or precision, as in meaning; vague: an indeterminate
> turn of phrase.[/color]
This - if I understand it properly - is again closer to unknown than to
non-existing (which is the value of an uninitialized POD)
[color=blue]
> d)Not fixed or known in advance: an indeterminate future.[/color]
Again: will be known, only later
[color=blue]
> e)Not leading up to a definite result or ending: an indeterminate
> campaign.[/color]
This meaning is about an action or series of actions. Cannot really be
applied to a value.
[color=blue]
> So indeterminate can mean either not precisely determined or not
> determinable.[/color]
Not determinable from the viewpoint of the observer! BIG difference. The
person of indeterminate age *has* an age. A indeterminate campaign *will*
have an end and a result - if not later than on judgment day.
[color=blue]
> The standard clearly uses it to mean not determinable
> (since you aren't allowed to examine the value).[/color]
I see no such meaning in the listed definitions above. Each and every of
those things above objectively *exist* we just could not, will not, do not
want to determine. OTOH the value of an int, which is built from bits which
makes no sense as an int, is just not there. It does not exist. It is not
an int. There is no sense in talking about it as an int. Since there is no
sense talking about it as an int there is not much sense talking about its
value.
[color=blue][color=green][color=darkred]
>>> There are even more catches to this.
>>>
>>> unsigned char c;
>>> c = c; //legal![/color][/color][/color]
Should not be. c is used as an rvalue there...
[color=blue][color=green][color=darkred]
>>> unsigned char can never have indeterminate values (because all bits
>>> of the object representation take part in the value representation) .[/color]
>>
>> Where is that required by the standard?[/color][/color]
Weird! Why would someone ask for such an arbitrary requirement?
[color=blue]
> 3.9.1/1
> Also:
> http://std.dkuug.dk/jtc1/sc22/wg21/d...ctive.html#129[/color]
Hmmmm. This is baaad. I mean this reads: in C++ it is not even not
guaranteed that a variable (POD) has a valid value until it is given one,
but it is not even required to *exist* in its *exclusive* storage... While
I completely agree with what is written in the DR/TR/xR(?) I believe that
this is more than surprising. So not only (real) initialization is optional
but even creation...
[color=blue][color=green][color=darkred]
>>> This is
>>> useful elsewhere though: invalid pointers do have indeterminate
>>> values, according to the note in 5.3.5/4.[/color]
>>
>> Again a bit of a mystery. delete take a *copy* of the pointer. So
>> it cannot change it at all. So the value of the pointer *is*
>> determined, we exactly know what value it has. Only this value is
>> not to be dereferenced.[/color]
>
> It is indeterminate since, although the bit pattern won't have
> changed, valid bit patterns for pointers might have been changed by
> the delete.[/color]
It is not indeterminate. I know what it is. I can determine it. It is
just not valid to be *dereferenced*. I can even store away together with
sand from the Oregon dunes, my childhood golden hair and photos of my late
girlfriend (she is alive, she just never arrives in time) into an in-memory
application log (possibly as a void*). So the pointer has a *valid* value.
I can copy it around. (at lest I hope so). I just cannot dereference it.
If I cannot (even copy it around - which would make sense) then I dunno
enough C++. :-) Which is true, but this would further prove it. BTW I
never did copy it around, only it could make sense for such logging
purposes.
--
WW aka Attila
tom_usenet wrote:[color=blue][color=green]
>> Well, in my poor English vocabulary that is non-determinable.
>> Indeterminate is (for me) something we do not know for sure (like
>> what will rand put there) but we can find out later.
>> Non-determinable is OTOH something which cannot be examined.[/color]
>
> Indeterminate:
> a)Not precisely determined, determinable, or established: a person of
> indeterminate age.[/color]
He *has* an age, we just do not know it. It is not like he has no such
thing as an age. While uninitialized PODs may have such bits in their
storage that they have no value whatsoever.
[color=blue]
> b)Not precisely fixed, as to extent, size, nature, or number: an
> indeterminate number of plant species in the jungle.[/color]
So many, we cannot/will not count it. Again: it is an existing, valid
value.
[color=blue]
> c)Lacking clarity or precision, as in meaning; vague: an indeterminate
> turn of phrase.[/color]
This - if I understand it properly - is again closer to unknown than to
non-existing (which is the value of an uninitialized POD)
[color=blue]
> d)Not fixed or known in advance: an indeterminate future.[/color]
Again: will be known, only later
[color=blue]
> e)Not leading up to a definite result or ending: an indeterminate
> campaign.[/color]
This meaning is about an action or series of actions. Cannot really be
applied to a value.
[color=blue]
> So indeterminate can mean either not precisely determined or not
> determinable.[/color]
Not determinable from the viewpoint of the observer! BIG difference. The
person of indeterminate age *has* an age. A indeterminate campaign *will*
have an end and a result - if not later than on judgment day.
[color=blue]
> The standard clearly uses it to mean not determinable
> (since you aren't allowed to examine the value).[/color]
I see no such meaning in the listed definitions above. Each and every of
those things above objectively *exist* we just could not, will not, do not
want to determine. OTOH the value of an int, which is built from bits which
makes no sense as an int, is just not there. It does not exist. It is not
an int. There is no sense in talking about it as an int. Since there is no
sense talking about it as an int there is not much sense talking about its
value.
[color=blue][color=green][color=darkred]
>>> There are even more catches to this.
>>>
>>> unsigned char c;
>>> c = c; //legal![/color][/color][/color]
Should not be. c is used as an rvalue there...
[color=blue][color=green][color=darkred]
>>> unsigned char can never have indeterminate values (because all bits
>>> of the object representation take part in the value representation) .[/color]
>>
>> Where is that required by the standard?[/color][/color]
Weird! Why would someone ask for such an arbitrary requirement?
[color=blue]
> 3.9.1/1
> Also:
> http://std.dkuug.dk/jtc1/sc22/wg21/d...ctive.html#129[/color]
Hmmmm. This is baaad. I mean this reads: in C++ it is not even not
guaranteed that a variable (POD) has a valid value until it is given one,
but it is not even required to *exist* in its *exclusive* storage... While
I completely agree with what is written in the DR/TR/xR(?) I believe that
this is more than surprising. So not only (real) initialization is optional
but even creation...
[color=blue][color=green][color=darkred]
>>> This is
>>> useful elsewhere though: invalid pointers do have indeterminate
>>> values, according to the note in 5.3.5/4.[/color]
>>
>> Again a bit of a mystery. delete take a *copy* of the pointer. So
>> it cannot change it at all. So the value of the pointer *is*
>> determined, we exactly know what value it has. Only this value is
>> not to be dereferenced.[/color]
>
> It is indeterminate since, although the bit pattern won't have
> changed, valid bit patterns for pointers might have been changed by
> the delete.[/color]
It is not indeterminate. I know what it is. I can determine it. It is
just not valid to be *dereferenced*. I can even store away together with
sand from the Oregon dunes, my childhood golden hair and photos of my late
girlfriend (she is alive, she just never arrives in time) into an in-memory
application log (possibly as a void*). So the pointer has a *valid* value.
I can copy it around. (at lest I hope so). I just cannot dereference it.
If I cannot (even copy it around - which would make sense) then I dunno
enough C++. :-) Which is true, but this would further prove it. BTW I
never did copy it around, only it could make sense for such logging
purposes.
--
WW aka Attila
Comment