libcxx patch for N3655
Howard Hinnant
hhinnant at apple.com
Wed Jul 3 14:31:29 PDT 2013
On Jul 3, 2013, at 2:44 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
>
> On Jul 3, 2013, at 9:37 AM, Howard Hinnant <howard.hinnant at gmail.com> wrote:
>
>> On Jul 2, 2013, at 2:43 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
>>
>>> In N3655 (the first half of which was incorporated into C++14), Walter added a bunch of template aliases to simplify template metaprogramming.
>>>
>>> Lots of stuff like this:
>>> template <class T> using remove_const_t = typename remove_const<T>::type;
>>>
>>> This patch adds all those aliases into libc++, and tests.
>>> Also some drive-by cleanups of existing tests.
>>
>> Thanks Marshall. I think you did your svn diff from the wrong subdirectory. The patch doesn't include an updated <type_traits>.
>
> D'oh!
>
> Here's a better patch.
Looks pretty good to me. I've enclosed a few differences:
1. I tried to verify that those traits that do work in C++03 mode still worked. But I've let the '03 test suite deteriorate to the point that I was getting too many errors in '03 mode to see what had changed. So I took this opportunity to first make meta test cleanly in '03 mode.
2. To get your patch to test cleanly in C++03 mode I had to wrap static_assert in some irritating '()', and emulate variadics in a couple of tests.
3. I removed 'const' from the size_t in both aligned_storage and aligned_storage_t. That was just a latent bug and this was a good opportunity to clean that up.
4. I removed typename from several of the new tests. The typename didn't hurt, but it was nice to see that it is no longer needed with these new aliases.
You did a nice job with the updated comments, the macro protection and the c++1y protection. I couldn't find anything else to whine about. :-) Oh, I did remove section numbers from the comment section. They get outdated really quickly and become impossible to keep correct.
Howard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: type_traits.patch
Type: application/octet-stream
Size: 113655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130703/ec438b71/attachment.obj>
More information about the cfe-commits
mailing list