[PATCH] libstdc++: Diagnose visitors with different return types [PR95904]

Ville Voutilainen ville.voutilainen@gmail.com
Tue Sep 29 16:35:32 GMT 2020


On Tue, 29 Sep 2020 at 14:20, Jonathan Wakely <jwakely@redhat.com> wrote:
> I think this is what we want:
>
>    template<typename _Tp, typename... _Types>
>      constexpr inline __same_types = (is_same_v<_Tp, _Types> && ...);
>
> is_same_v is very cheap, it uses the built-in directly, so you don't
> need to instantiate any class templates at all.
>
> >+
> >+  template <unsigned long int _Idx, class _Visitor, class _Variant>
>
> typename not class please.
>
> >+    decltype(auto) __check_visitor_result(_Visitor&& __vis,
>
> New line after the decltype(auto) please, not in the middle of the
> parameter list.

Aye.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr95904_2.diff
Type: text/x-patch
Size: 3448 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20200929/5244e4bd/attachment.bin>


More information about the Libstdc++ mailing list