<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_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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/<wbr>cpp/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="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>-- <br><div class="m_-8091554864542029026gmail_signature"><div dir="ltr">Zeson<br></div></div>
</div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">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>