[PATCH] [libc++] Check the support of default function template args.

Logan Chien tzuhsiang.chien at gmail.com
Wed Jan 29 06:36:21 PST 2014


Ping.

This is a commit to move several std::enable_if<Cond, T>::type from default
template arguments to the return type (or formal argument type.)  This
pattern has been used in the same file and make the header C++98
compatible.  IMO, it is important to keep the C++98 headers compatible with
old standard.  This patch is the last piece to rich this goal.  Please have
a look.  Thanks.

http://llvm-reviews.chandlerc.com/D2384


On Thu, Jan 16, 2014 at 10:41 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:

> Ping.  Is this OK to commit?  Thanks.
>
>
>
> On Thu, Jan 9, 2014 at 12:10 AM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
>
>> Ping.
>>
>> http://llvm-reviews.chandlerc.com/D2384
>>
>>
>> On Mon, Jan 6, 2014 at 10:01 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
>>
>>> Ping.
>>>
>>> Summary:  This patch is a part of the efforts (and the last one) to make
>>> g++ being able to compile libc++ *headers* in C++98 mode.  This patch
>>> removes the default function template arguments in <memory> and preserve
>>> SFINAE by moving enable_if<> to function return type or argument type.
>>>
>>> For example,
>>>
>>> -    template <class _Pp,* class = typename enable_if<...>*>
>>> -    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p) _NOEXCEPT
>>>
>>> is changed to:
>>>
>>> +    template <class _Pp>
>>> +    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p,
>>> +            *typename enable_if<..., __nat>::type = __nat()*) _NOEXCEPT
>>>
>>> Please have a look.  Thanks.
>>>
>>> Sincerely,
>>> Logan
>>>
>>>
>>> On Sat, Dec 28, 2013 at 1:54 AM, Logan Chien <tzuhsiang.chien at gmail.com>wrote:
>>>
>>>> Hi Howard,
>>>>
>>>> I am doing some experiment to replace stlport with libc++ in the
>>>> Android platform, which does not have libstdc++.  Although I can compile
>>>> the libc++ library itself with clang, I can't build the world with clang at
>>>> the moment.  Thus, I wish to make the C++98/03 headers compatible with g++,
>>>> so that I can include them without problems.
>>>>
>>>> Sincerely,
>>>> Logan
>>>>
>>>>
>>>> On Sat, Dec 28, 2013 at 1:05 AM, Howard Hinnant <
>>>> howard.hinnant at gmail.com> wrote:
>>>>
>>>>> Hi Logan,
>>>>>
>>>>> Could you comment on the motivation for using g++ + libc++.  I.e., why
>>>>> use libc++ instead of the libstdc++ that comes bundled with g++?
>>>>>
>>>>> Thanks,
>>>>> Howard
>>>>>
>>>>> On Dec 26, 2013, at 11:08 AM, Logan Chien <tzuhsiang.chien at gmail.com>
>>>>> wrote:
>>>>>
>>>>> > Ping.
>>>>> >
>>>>> >
>>>>> > On Fri, Dec 20, 2013 at 10:53 PM, Logan Chien <
>>>>> tzuhsiang.chien at gmail.com> wrote:
>>>>> > Ping.  Any further comments?
>>>>> >
>>>>> > This patch tries to reduce the usage of the default function
>>>>> template arguments, which is not supported in pre-C++0x.  Without this
>>>>> change, we will get compilation error from g++ if we tries to include
>>>>> libc++ headers in pre-C++0x mode.
>>>>> >
>>>>> > To remove the usage of default function template arguments, the
>>>>> patch moves the enable_if<> to return type or the function argument types.
>>>>>  This pattern is used in the other code of libc++ as well.
>>>>> >
>>>>> > Please let me know if you have any comments.  Thanks.
>>>>> >
>>>>> > Sincerely,
>>>>> > Logan
>>>>> >
>>>>> > _______________________________________________
>>>>> > cfe-commits mailing list
>>>>> > cfe-commits at cs.uiuc.edu
>>>>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140129/939bf582/attachment.html>


More information about the cfe-commits mailing list