We require rvalue support anyways, so let's use it.
Details
- Reviewers
ldionne Mordante var-const huixie90 - Group Reviewers
Restricted Project - Commits
- rGe0b3356e67a9: [libc++] Enable rvalue overloads for pair in C++03
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
libcxx/include/__utility/pair.h | ||
---|---|---|
424–445 | I guess this somehow changed the c++ 03 behaviour. it used to make copies on 1. function parameters 2. constructor initialisers |
libcxx/include/__utility/pair.h | ||
---|---|---|
424–445 | I was going to say this: I don't think it is, actually, because in C++03 make_pair is explicitly specified like template< class T1, class T2 > std::pair<T1,T2> make_pair( T1 t, T2 u ); IMO the rest of these changes are OK, but this one does changes our C++03 API (which one day we will deprecate if my dreams become reality). But then, @philnik reminded me that libc++ was originally built to implement the C++11 standard even on top of a C++03 compiler, and that is actually one of the things we tell users. In other words, we never really faithfully implement C++03 anyways. For example, we provide all kinds of things like std::shared_ptr in C++03 mode, and those are all C++11 features. So yeah, I think it's fine to drop this. And it only reinforces my desire to get a discussion started on deprecating C++03 support entirely. | |
486 | This one is definitely good. std::get(pair) was added in C++11/14 depending on the overloads, and we probably only did that before rvalue references as a C++03 extension in Clang. | |
libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp | ||
3 | Side comment, but we do seem to have quite a few files that haven't moved to the new license. You could make a NFC with those without review if you want. |
I guess this somehow changed the c++ 03 behaviour. it used to make copies on 1. function parameters 2. constructor initialisers
Now it only make the copy inside constructors. Is it ok to make this change?