public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-3159] libstdc++: Shuffle header dependencies of <functional>
Date: Fri,  7 Oct 2022 11:56:46 +0000 (GMT)	[thread overview]
Message-ID: <20221007115646.4BA4F3858CDA@sourceware.org> (raw)

https://gcc.gnu.org/g:93b3ab6c0c6a44df50e9312c8106b4d1001d6205

commit r13-3159-g93b3ab6c0c6a44df50e9312c8106b4d1001d6205
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Oct 6 14:34:49 2022 +0100

    libstdc++: Shuffle header dependencies of <functional>
    
    The <new> header is needed by std::function to use placement new, so
    include it in <bits/std_function.h> instead of in <functional>.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/std_function.h: Include <new> but do not include
            <bits/stl_function.h>.
            * include/std/functional: Do not include <new>.

Diff:
---
 libstdc++-v3/include/bits/std_function.h | 10 +++++-----
 libstdc++-v3/include/std/functional      |  7 +++----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/libstdc++-v3/include/bits/std_function.h b/libstdc++-v3/include/bits/std_function.h
index f5423a3a5c7..8ab32a6855e 100644
--- a/libstdc++-v3/include/bits/std_function.h
+++ b/libstdc++-v3/include/bits/std_function.h
@@ -36,11 +36,11 @@
 # include <bits/c++0x_warning.h>
 #else
 
-#include <typeinfo>
-#include <bits/stl_function.h>
-#include <bits/invoke.h>
-#include <bits/refwrap.h>
-#include <bits/functexcept.h>
+#include <new>                // placement new
+#include <typeinfo>           // typeid
+#include <bits/invoke.h>      // __invoke_r
+#include <bits/refwrap.h>     // ref wrapper, _Maybe_unary_or_binary_function
+#include <bits/functexcept.h> // __throw_bad_function_call
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index adf9cb1c546..d22acaa3cb8 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -46,11 +46,10 @@
 #pragma GCC system_header
 
 #include <bits/c++config.h>
-#include <bits/stl_function.h>
+#include <bits/stl_function.h> // std::equal_to, std::unary_function etc.
 
 #if __cplusplus >= 201103L
 
-#include <new>
 #include <tuple>
 #include <type_traits>
 #include <bits/functional_hash.h>
@@ -67,8 +66,8 @@
 # endif
 # include <bits/stl_algo.h> // std::search
 #endif
-#if __cplusplus > 201703L
-# include <bits/ranges_cmp.h>
+#if __cplusplus >= 202002L
+# include <bits/ranges_cmp.h> // std::identity, ranges::equal_to etc.
 # include <compare>
 #endif
 #if __cplusplus > 202002L && _GLIBCXX_HOSTED

                 reply	other threads:[~2022-10-07 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221007115646.4BA4F3858CDA@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).