public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Simplify preprocessor/namespace nesting in <bits/move.h>
@ 2023-04-28 12:07 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-04-28 12:07 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested powerpc64le-linux. Pushed to trunk.

-- >8 --

There's no good reason to conditionally close and reopen namespace std
within an #if block. Just include the <type_traits> header at the top
instead.

libstdc++-v3/ChangeLog:

	* include/bits/move.h: Simplify opening/closing namespace std.
---
 libstdc++-v3/include/bits/move.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index 6bc70e8e724..4a8fceff96a 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -33,6 +33,8 @@
 #include <bits/c++config.h>
 #if __cplusplus < 201103L
 # include <bits/concept_check.h>
+#else
+# include <type_traits> // Brings in std::declval too.
 #endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
@@ -51,15 +53,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if __cplusplus >= 201103L
 
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
-#include <type_traits> // Brings in std::declval too.
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
   /**
    *  @addtogroup utilities
    *  @{
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-28 12:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 12:07 [committed] libstdc++: Simplify preprocessor/namespace nesting in <bits/move.h> 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).