This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR libstdc++/79162 ambiguity in string assignment due to string_view overload (LWG 2946)
- From: Daniel Krügler <daniel dot kruegler at gmail dot com>
- To: Tim Song <t dot canens dot cpp at gmail dot com>
- Cc: libstdc++ at gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Jul 2017 22:29:50 +0200
- Subject: Re: [PATCH] PR libstdc++/79162 ambiguity in string assignment due to string_view overload (LWG 2946)
- Authentication-results: sourceware.org; auth=none
- References: <CAGNvRgCv1Y8a6DGO=p9g8FAve1-UKf53vshqFYtdmWkDUzn8+Q@mail.gmail.com> <CAPQZVxuSmudm3+CUv5y7CQDLO0+QBuYjq2xKwWQ8ibtWxv3V9A@mail.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.
Thanks,
- Daniel