Re: CRTP and ctors
On 25 Nov., 17:56, Seungbeom Kim <musip...@bawi.org> wrote:
[..] I just mean that it's wrong to declare
something UB in two phases altogether, when the real intention is
to declare it UB in only one of them (as 3.8 does). That is, when
something in phase A is UB and the same thing in phase B is not,
it's wrong to say it's UB in phase A+B.
Now my understanding (with your help) is that the wording of 3.8,
"Before the lifetime of an object has started but after the storage
which the object will occupy has been allocated", should be changed to
"Before the constructor of an object has started but after the storage
which the object will occupy has been allocated", or something similar.
Similarly for the destruction phase. Did I understand you correctly?
OK, good that I asked again ;-)
My first posting in this thread was written to provide my personal
interpretation of the differences (and commonalities) of sections
3.8 and 12 of (lets say) N2798. At this point it was *not* my
intention to imply that I assume that e.g. 3.8 does *incorrectly*
not divide the two phases I wrote of. IMO this section does indeed
mean both phases - but it doesn't say so explicitly because it
doesn't case. Section 12.7 is typically restricted to the phase
B, as you name it.
I wanted to say that one needs to read both sections in parallel,
because 3.8 enumerates cases where some things done with
instance properties of an "upcoming object" are undefined, and
some are well-defined. If the wording generally classifies some
actions causing undefined behavior, but mentions special conditions,
where these seemingly same actions are well-defined, we have the
overruling situation I mentioned. This overruling happens in 3.8
itself (e.g. p. 7) and also in section 12.7 (e.g. the usage
of dynamic_cast and virtual functions in the constructor body).
The point where we have an issue here is when someone recognizes
that this overruling situation is unclear or ambiguous.
Maybe it didn't become clear to me, that there is such a possible
issue. If you think so, it would be nice, if you would (once
again?) point on that.
Thanks,
Daniel
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]