<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Calisto MT";
        panose-1:2 4 6 3 5 5 5 3 3 4;}
@font-face
        {font-family:LMRoman10;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calisto MT","serif";
        color:#7030A0;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1312977485;
        mso-list-template-ids:-1766428590;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Calisto MT","serif";color:#7030A0">One of the things that bothers me with the array thing is that conceptually, an array is just like a structure with homogeneous elements (and we do actually tend to think of it
that way in certain parts of the library, e.g. see std::complex). Furthermore, I don’t see the point of this “exception”.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calisto MT","serif";color:#7030A0"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calisto MT","serif";color:#7030A0">As for an object type with “trivial initialization”, I suspect that the general confusion comes from the fact for some reasons the standards text assumed that it could just “optimize”
that case without much confusion. But evidence appear to suggest otherwise. Complexity has grown, with increased likelihood of inconsistency. What is the meaning of T{ } when T is a POD struct? Do you think there is no lifetime there?
<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-family:"Calisto MT","serif";color:#7030A0"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> ub-bounces@open-std.org [mailto:ub-bounces@open-std.org]
<b>On Behalf Of </b>David Krauss<br>
<b>Sent:</b> Friday, January 17, 2014 5:46 AM<br>
<b>To:</b> WG21 UB study group<br>
<b>Subject:</b> Re: [ub] type punning through congruent base class?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Jan 17, 2014, at 8:42 PM, Gabriel Dos Reis <<a href="mailto:gdr@microsoft.com">gdr@microsoft.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Calisto MT","serif";color:#7030A0">In C++, there is a relationship between the lifetime of a complete object and that of its subobjects – the only exception I know of is that of arrays, which has it th opposite
way (wrong!) and is on my list of things to get fixed (already reported that in the past.) I don’t understand the bit about new-expression.</span><o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">It sounds like both cases are covered by §3.8/2:<o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<p style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">
</span></span><![endif]><span style="font-size:10.0pt;font-family:"LMRoman10","serif"">[
<i>Note: </i>The lifetime of an array object starts as soon as storage with proper size and alignment is obtained, and its lifetime ends when the storage which the array occupies is reused or released.
<span style="color:blue">12.6.2 </span>describes the lifetime of base and member subobjects.
<i>— end note </i>]</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal">As for arrays, yes that sounds backwards. If the lifetime of the whole array starts before initialization finishes, that might imply something crazy like the ability to destroy all of it in the middle of initialization. (I don’t know what
normative text makes the note correct, though.)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As for objects of class types, [class.base.init] 12.6.2 only seems to mention initialization, not lifetimes in the abstract sense, but I was only talking about objects with trivial initialization, for which initialization plays no part
in determining lifetime.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Am I missing something else?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>