This is an archive of the discontinued LLVM Phabricator instance.

Implement P0433: deduction guides for <unordered_map>
ClosedPublic

Authored by Quuxplusone on Feb 24 2019, 12:10 AM.

Diff Detail

Repository
rCXX libc++

Event Timeline

Add <algorithm> header to the tests, for the benefit of libstdc++.

Use ASSERT_SAME_TYPE. Add comments to deduct.fail.cpp. Rebase.

Quuxplusone added a subscriber: STL_MSFT.

Mark LWG3025 status "Complete". (Thanks @STL_MSFT for pointing me at that issue!)

Quuxplusone retitled this revision from Implement deduction guides for <unordered_map> to Implement P0433: deduction guides for <unordered_map>.Mar 4 2019, 7:24 PM
Quuxplusone edited the summary of this revision. (Show Details)

Rebased on master (well, on D58587).
Add tests for the resolution of LWG 3025.

Review comments; remove unnecessary _VSTD:: before remove_const; consistent use of typedefs P and PC to match the corresponding unordered_map tests from D58587.

@mclow.lists: I think this one is ready to land, as well as D58617, although they probably deserve some close scrutiny to make sure the tests are testing the things they should be testing.

I wonder if I should switch from using typename remove_const<T>::type to remove_const_t<T>, since all the deduction guides are compiled only in C++17 mode anyway. If we want to do that, I propose to do it as a separate patch, or at least shortly thereafter to submit a separate patch to consistently use remove_const_t in the <set> and <map> deduction guides.

ldionne requested changes to this revision.Jun 18 2019, 7:41 AM

Can you test this against Clang trunk and confirm that it works?

This revision now requires changes to proceed.Jun 18 2019, 7:41 AM
Quuxplusone edited the summary of this revision. (Show Details)

Use _EnableIf and remove_const_t instead of enable_if and remove_const.
Whitespace diffs.
Preemptively add XFAILs on apple-clang, matching the XFAILs that were needed for unordered_set.

@ldionne ping! I believe this is ready to land.

This completes my patch-series on the topic of "CTAD for associative and unordered containers."

Btw, I've verified that the container adaptors are all done (by Marshall, a while ago). The one place libc++ is known to be still missing deduction guides is std::function ( https://bugs.llvm.org/show_bug.cgi?id=39606 ).

This revision was not accepted when it landed; it landed in state Needs Review.Jul 15 2019, 1:05 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2019, 1:05 PM