* [PATCH] Minor header reorganization for unordered containers
@ 2017-10-30 14:57 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2017-10-30 14:57 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 439 bytes --]
In the spirit of "include what you use" (and because I couldn't find
why <unordered_map> and <unordered_set> include <tuple> when they
don't use it ... it's because <bits/hashtable_policy.h> uses it).
* include/bits/hashtable_policy.h: Include <tuple>.
* include/std/unordered_map: Only include <bits/stl_pair.h> instead
of <utility> and <tuple>.
* include/std/unordered_set: Likewise.
Tested powerpc64le-linux, committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2262 bytes --]
commit 58390a166cfda1cb7db2ccc65c6515f3d48892ec
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Oct 30 14:40:51 2017 +0000
Minor header reorganization for unordered containers
* include/bits/hashtable_policy.h: Include <tuple>.
* include/std/unordered_map: Only include <bits/stl_pair.h> instead
of <utility> and <tuple>.
* include/std/unordered_set: Likewise.
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index da6d49c96c4..e19f92abd76 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -31,7 +31,9 @@
#ifndef _HASHTABLE_POLICY_H
#define _HASHTABLE_POLICY_H 1
-#include <bits/stl_algobase.h> // for std::min.
+#include <tuple> // for std::tuple, std::forward_as_tuple
+#include <cstdint> // for std::uint_fast64_t
+#include <bits/stl_algobase.h> // for std::min.
namespace std _GLIBCXX_VISIBILITY(default)
{
diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map
index 2cdcd377936..80773235b65 100644
--- a/libstdc++-v3/include/std/unordered_map
+++ b/libstdc++-v3/include/std/unordered_map
@@ -35,13 +35,12 @@
# include <bits/c++0x_warning.h>
#else
-#include <utility>
#include <type_traits>
#include <initializer_list>
-#include <tuple>
#include <bits/allocator.h>
#include <ext/alloc_traits.h>
#include <ext/aligned_buffer.h>
+#include <bits/stl_pair.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <bits/functional_hash.h>
#include <bits/hashtable.h>
diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set
index 2646c0f2f00..faf7ebe23ae 100644
--- a/libstdc++-v3/include/std/unordered_set
+++ b/libstdc++-v3/include/std/unordered_set
@@ -35,13 +35,12 @@
# include <bits/c++0x_warning.h>
#else
-#include <utility>
#include <type_traits>
#include <initializer_list>
-#include <tuple>
#include <bits/allocator.h>
#include <ext/alloc_traits.h>
#include <ext/aligned_buffer.h>
+#include <bits/stl_pair.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <bits/functional_hash.h>
#include <bits/hashtable.h>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-30 14:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 14:57 [PATCH] Minor header reorganization for unordered containers Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).