This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR libstdc++/79162 ambiguity in string assignment due to string_view overload (LWG 2946)


Hi,

This is a friendly reminder asking for a review of the suggested patch!

Thanks,

- Daniel

2017-07-30 15:01 GMT+02:00 Daniel Krügler <daniel.kruegler@gmail.com>:
> 2017-07-28 22:40 GMT+02:00 Daniel Krügler <daniel.kruegler@gmail.com>:
>> 2017-07-28 22:29 GMT+02:00 Daniel Krügler <daniel.kruegler@gmail.com>:
>>> 2017-07-28 22:25 GMT+02:00 Tim Song <t.canens.cpp@gmail.com>:
>>>> On Fri, Jul 28, 2017 at 4:10 PM, Daniel Krügler
>>>> <daniel.kruegler@gmail.com> wrote:
>>>>> +      // Performs an implicit conversion from _Tp to __sv_type.
>>>>> +      template<typename _Tp>
>>>>> +        static __sv_type _S_to_string_view(const _Tp& __svt)
>>>>> +        {
>>>>> +          return __svt;
>>>>> +        }
>>>>
>>>> I might have gone for
>>>>
>>>> +        static __sv_type _S_to_string_view(__sv_type __svt) noexcept
>>>> +        {
>>>> +          return __svt;
>>>> +        }
>>>>
>>>> With that, we can also use noexcept(_S_to_string_view(__t)) to make up
>>>> for the absence of is_nothrow_convertible (basically the same thing I
>>>> did in LWG 2993's PR).
>>>
>>> Agreed, that makes very much sense. I will adjust the P/R, but before
>>> I resubmit I would like to get feedback whether the other two compare
>>> functions also should become conditionally noexcept.
>>
>> Locally I have now performed the sole change of the _S_to_string_view
>> declaration getting rid of the template, but would also like to gather
>> feedback from the maintainers whether I should also change the form of
>> the conditional noexcept to use the expression
>>
>> noexcept(_S_to_string_view(__t))
>>
>> instead of the current
>>
>> is_same<_Tp, __sv_type>::value
>>
>> as suggested by Tim Song.
>>
>> I'm asking also, because I have a paper proposing to standardize
>> is_nothrow_convertible submitted for the upcoming C++ mailing - This
>> would be one of the first applications in the library ;-)
>
> A slightly revised patch update: It replaces the _S_to_string_view
> template by a simpler _S_to_string_view function as of Tim Song's
> suggestion, but still uses the simplified noexcept specification
> deferring it to a future application case for is_nothrow_convertible.
> Furthermore now all three compare function templates are now
> (conditionally) noexcept by an (off-list) suggestion from Jonathan
> Wakely.
>
> Thanks,
>
> - Daniel



-- 

________________________________
SavedURI :Show URLShow URLSavedURI :
SavedURI :Hide URLHide URLSavedURI :
https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.de.LEt2fN4ilLE.O/m=m_i,t,it/am=OCMOBiHj9kJxhnelj6j997_NLil29vVAOBGeBBRgJwD-m_0_8B_AD-qOEw/rt=h/d=1/rs=AItRSTODy9wv1JKZMABIG3Ak8ViC4kuOWA?random=1395770800154https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.de.LEt2fN4ilLE.O/m=m_i,t,it/am=OCMOBiHj9kJxhnelj6j997_NLil29vVAOBGeBBRgJwD-m_0_8B_AD-qOEw/rt=h/d=1/rs=AItRSTODy9wv1JKZMABIG3Ak8ViC4kuOWA?random=1395770800154
________________________________


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]