]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Simplify preprocessor/namespace nesting in <bits/move.h>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 28 Apr 2023 10:07:40 +0000 (11:07 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 28 Apr 2023 12:05:50 +0000 (13:05 +0100)
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

index 6bc70e8e7241c49837ae8d8a2030d697034dcda3..4a8fceff96acac8caa94aaa12a856c3f2c5d0b01 100644 (file)
@@ -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
    *  @{