<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-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.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.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;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Not that it’s a priority to support this, but I did run into this as well during my freestanding prototype. I used the versioned namespace macros to inject a different namespace name (in my case simt::std::) but I couldn’t do that with
 those few facilities that are put into std:: literally in the implementation of libc++. I found another way to do what I wanted to do that worked because I didn’t want to hook any of those facilities, but if I wanted to do that in the future I would like to
 see an unversioned namespace macro even if it’s always set to std:: in normal builds of libc++.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Olivier<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">libcxx-dev <libcxx-dev-bounces@lists.llvm.org> on behalf of Marshall Clow via libcxx-dev <libcxx-dev@lists.llvm.org><br>
<b>Reply-To: </b>Marshall Clow <mclow.lists@gmail.com><br>
<b>Date: </b>Wednesday, October 24, 2018 at 10:48 AM<br>
<b>To: </b>"ldionne@apple.com" <ldionne@apple.com><br>
<b>Cc: </b>"libcxx-dev@lists.llvm.org" <libcxx-dev@lists.llvm.org><br>
<b>Subject: </b>Re: [libcxx-dev] Question: Why are std::exception & friends not in a versioned namespace?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Oct 22, 2018 at 5:58 AM Louis Dionne via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org">libcxx-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Oct 19, 2018, at 3:18 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">On Wed, 17 Oct 2018 at 11:44, Ben Craig via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">"Magic" types that the compiler / core language know about don't go in the versioned namespace.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That certainly applies to things like std::type_info, std::initializer_list, and std::bad_alloc, but std::exception is not special in this regard.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Rather, I think the reason we don't version std::exception is so that in code that mixes use of libc++ and libstdc++, one can throw an exception derived from std::exception using one library and catch it using the other library. (A special
 case of that: the default 'terminate' handler can print out details of the thrown exception if it's derived from std::exception, even if it's using the std::exception from a different stdlib.)<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That makes a lot of sense. This means we have an official or unofficial "contract" with libstdc++ not to put those symbols in a versioned namespace.<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Right.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">We (the libc++ maintainers and the libstdc++ maintainers) agree that it would be nice to be able to mix code, and so we do this (and a couple other things) to make it so. For example, the libc++ exception classes look weird, but that's
 so they work like the libstdc++ ones.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- Marshall<o:p></o:p></p>
</div>
</div>
</div>
</div>

<DIV>
<HR>
</DIV>
<DIV>This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure 
or distribution is prohibited.  If you are not the intended recipient, 
please contact the sender by reply email and destroy all copies of the original 
message. </DIV>
<DIV>
<HR>
</DIV>
</body>
</html>