<div dir="ltr">Sorry to not reply to all. So FYI.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Zeson Wu</b> <span dir="ltr"><<a href="mailto:westion717@gmail.com">westion717@gmail.com</a>></span><br>Date: 2018-03-07 16:26 GMT+08:00<br>Subject: Re: [cfe-dev] [libc++] Is libc++ compatible with previous c++ language standard implementation<br>To: Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>><br><br><br><div dir="ltr"><div>although calling code shouldn't be able to tell the difference and it doesn't require any code changes on the user's part, I think the interface was changed and the semantic is also changed. <br></div>The following case will show different behavior. Or it's UB test point?<br><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#include <iostream><br>#include <vector><br><br>struct T<br>{<br> bool flag;<br> T() : flag(false) {}<br> T(const T&) : flag(true) {}<br>};<br><br><br>int main()<br>{<br> std::vector<T> test(1);<br> bool is_cpp11 = !test[0].flag;<br><br> std::cout << is_cpp11 << std::endl ;<br>}<br></blockquote><div> </div>Anyway, I find gcc libstdc++ has a guard to implement different version as following? But llvm libc++ is not.<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#<span class="gmail-m_-311838794820486767gmail-pl-k">if</span> __cplusplus >= 201103L
<table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC406" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-c"><span class="gmail-m_-311838794820486767gmail-pl-c">/*</span>*</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC407" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @brief Creates a %vector with default constructed elements.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC408" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __n The number of elements to initially create.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC409" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __a An allocator.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC410" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> *</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC411" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * This constructor fills the %vector with @a __n default</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC412" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * constructed elements.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC413" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> <span class="gmail-m_-311838794820486767gmail-pl-c">*/</span></span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC414" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-k">explicit</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC415" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-en">vector</span>(size_type __n, <span class="gmail-m_-311838794820486767gmail-pl-k">const</span> allocator_type& __a = allocator_type())</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC416" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> : _Base(__n, __a)</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC417" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> { <span class="gmail-m_-311838794820486767gmail-pl-c1">_M_default_initialize</span>(__n); }</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC418" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line">
</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC419" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-c"><span class="gmail-m_-311838794820486767gmail-pl-c">/*</span>*</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC420" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @brief Creates a %vector with copies of an exemplar element.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC421" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __n The number of elements to initially create.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC422" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __value An element to copy.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC423" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __a An allocator.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC424" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> *</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC425" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * This constructor fills the %vector with @a __n copies of @a __value.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC426" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> <span class="gmail-m_-311838794820486767gmail-pl-c">*/</span></span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC427" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-en">vector</span>(size_type __n, <span class="gmail-m_-311838794820486767gmail-pl-k">const</span> value_type& __value,</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC428" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-k">const</span> allocator_type& __a = allocator_type())</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC429" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> : _Base(__n, __a)</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC430" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> { <span class="gmail-m_-311838794820486767gmail-pl-c1">_M_fill_initialize</span>(__n, __value); }</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC431" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line">#<span class="gmail-m_-311838794820486767gmail-pl-k">else</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC432" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-c"><span class="gmail-m_-311838794820486767gmail-pl-c">/*</span>*</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC433" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @brief Creates a %vector with copies of an exemplar element.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC434" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __n The number of elements to initially create.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC435" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __value An element to copy.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC436" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * @param __a An allocator.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC437" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> *</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC438" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> * This constructor fills the %vector with @a __n copies of @a __value.</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC439" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"><span class="gmail-m_-311838794820486767gmail-pl-c"> <span class="gmail-m_-311838794820486767gmail-pl-c">*/</span></span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC440" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-k">explicit</span></td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC441" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-en">vector</span>(size_type __n, <span class="gmail-m_-311838794820486767gmail-pl-k">const</span> value_type& __value = value_type(),</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC442" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> <span class="gmail-m_-311838794820486767gmail-pl-k">const</span> allocator_type& __a = allocator_type())</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC443" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> : _Base(__n, __a)</td>
</tr>
<tr>
</tr></tbody></table><table class="gmail-m_-311838794820486767gmail-highlight gmail-m_-311838794820486767gmail-tab-size gmail-m_-311838794820486767gmail-js-file-line-container"><tbody><tr><td id="gmail-m_-311838794820486767gmail-LC444" class="gmail-m_-311838794820486767gmail-blob-code gmail-m_-311838794820486767gmail-blob-code-inner gmail-m_-311838794820486767gmail-js-file-line"> { <span class="gmail-m_-311838794820486767gmail-pl-c1">_M_fill_initialize</span>(__n, __value); }</td>
</tr>
<tr>
</tr></tbody></table>#<span class="gmail-m_-311838794820486767gmail-pl-k">endif</span></blockquote><div><br> </div></div></div><div class="gmail_extra"><div><div class="gmail-h5"><br><div class="gmail_quote">2018-03-07 15:25 GMT+08:00 Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'm not sure about libc++'s support for pre-C++11, but I think it does support earlier standards. The constructor you're asking about isn't a great example to look at. The function signature (1) was split into two different functions in C++11 rather than using a defaulted argument. But the calling code shouldn't be able to tell the difference. It doesn't require any code changes on the user's part.<div><br></div><div>It also looks like even the defaulted argument for alloc is implemented in libc++ with different signatures which is different than what the spec says. But again user code can't tell.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail-m_-311838794820486767m_6707511810649300511gmail_signature">~Craig</div></div>
<br><div class="gmail_quote"><div><div class="gmail-m_-311838794820486767h5">On Tue, Mar 6, 2018 at 10:38 PM, Zeson Wu via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_-311838794820486767h5"><div dir="ltr"><div>Hi, All.<br><br></div>Does anybody know that whether libc++ is compatible with previous c++ language standard implementation or not? For example, I know libc++ is now support c++11, I will show a example.<br><br><a href="http://en.cppreference.com/w/cpp/container/vector/vector" target="_blank">http://en.cppreference.com/w/c<wbr>pp/container/vector/vector</a>. In the reference, there are two different constructors for vector, <br><br>explicit vector( size_type count, const T& value = T(), const Allocator& alloc = Allocator()); (until C++11) <b>(1)</b><br>explicit vector( size_type count );(since C++11) (until C++14) <b>(2)</b><br clear="all"><div><div><br></div><div>If I use vector<T> a(1), which one will be chosen with different c++ std command option, such as -std=c++03, -std=c++11? Actually, I can not find the (1) version in libc++ source.<br></div><div><br></div><div>In my option, both two functions should be implemented and guarded by related language level macro, but I can not find in libc++ source. So libc++ is not compatible with previous c++ language standard implementation?<br></div><div><br></div><div>Thanks.<span class="gmail-m_-311838794820486767m_6707511810649300511HOEnZb"><font color="#888888"><br><br></font></span></div><span class="gmail-m_-311838794820486767m_6707511810649300511HOEnZb"><font color="#888888"><div>-- <br><div class="gmail-m_-311838794820486767m_6707511810649300511m_-8091554864542029026gmail_signature"><div dir="ltr">Zeson<br></div></div>
</div></font></span></div></div>
<br></div></div>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br></div></div><span class="gmail-HOEnZb"><font color="#888888">-- <br><div class="gmail-m_-311838794820486767gmail_signature"><div dir="ltr">Zeson<br></div></div>
</font></span></div>
</div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Zeson<br></div></div>
</div>