[v3 PATCH] Implement N4387 and LWG 2367

Jonathan Wakely jwakely@redhat.com
Tue Jun 30 13:28:00 GMT 2015


On 13/06/15 21:05 +0300, Ville Voutilainen wrote:
>Another round! The new patch
>- makes sure not to change non-deduced parameters to deduced ones, and adds
>tests for that.
>- removes the name of the bool non-type template parameter for the 'concepts'.
>- introduces shortcuts for making the use of the 'concepts' more readable.

These bits are lovely jubbly.

>- changes library tag types into non-default-constructible ones.
>Without this, we
>can run into an ambiguity between the constructor template that takes
>(const _T1&, const _T2&)
>and the one that takes (allocator_arg_t, Alloc), when the call site
>calls it with ({}, somethingelse).
>We could avoid that by just not doing that in the library
>(experimental string searchers do that),
>but it's just daft to allow default-constructing a library tag type. I
>have filed an LWG issue to
>fix all tag types, but this patch doesn't yet touch nothrow_t and
>optional's in_place_t. I expect
>to submit follow-up patches for that.

I agree that default-constructing tag types doesn't make sense when we
have named constants to use. I also think it's a real pain in the
posterior that tuple<T,U>( {}, T{} } is ambiguous, but I'm not
comfortable with making all those tag types non-default constructible
until we get an indication how LWG feel about the proposal.

So I've removed that part of the patch and "fixed" the searcher that
used {} and became ambiguous. I have a follow-up patch coming that
will prevent the ambiguities differently.

Tested ppc64le-linux and committed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 54964 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150630/154c2296/attachment.bin>


More information about the Gcc-patches mailing list