diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-10-22 18:42:03 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-10-22 18:42:03 +0100 |
commit | b1e7c6fce15b8ad222f265df2537701407fd289e (patch) | |
tree | bc07e74fd4675e1cd057e0dc7eaa2112cf2214e3 /libstdc++-v3/include/std/condition_variable | |
parent | d667beea36ba90bd47f1dd5f4a92a8d43a8ff207 (diff) | |
download | gcc-b1e7c6fce15b8ad222f265df2537701407fd289e.zip gcc-b1e7c6fce15b8ad222f265df2537701407fd289e.tar.gz gcc-b1e7c6fce15b8ad222f265df2537701407fd289e.tar.bz2 |
libstdc++: Reduce header dependencies in and on <memory>
By moving std::make_obj_using_allocator and the related "utility
functions for uses-allocator construction" to a new header, we can avoid
including the whole of <memory> in <scoped_allocator> and
<memory_resource>.
In order to simplify the implementation of those utility functions they
now use concepts unconditionally. They are no longer defined if
__cpp_concepts is not defined. To simplify the code that uses those
functions I've introduced a __cpp_lib_make_obj_using_allocator feature
test macro (not specified in the standard, which might be an oversight).
That allows the code in <memory_resource> and <scoped_allocator> to
check the feature test macro to decide whether to use the new utilities,
or fall back to the C++17 code.
At the same time, this reshuffles some of the headers included by
<memory> so that they are (mostly?) self-contained. It should no longer
be necessary to include other headers before <bits/shared_ptr.h> when
other parts of the library want to use std::shared_ptr without including
the whole of <memory>.
libstdc++-v3/ChangeLog:
* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/bits/shared_ptr.h: Include <iosfwd>.
* include/bits/shared_ptr_base.h: Include required headers here
directly, instead of in <memory>.
* include/bits/uses_allocator_args.h: New file. Move utility
functions for uses-allocator construction from <memory> to here.
Only define the utility functions when concepts are available.
(__cpp_lib_make_obj_using_allocator): Define non-standard
feature test macro.
* include/std/condition_variable: Remove unused headers.
* include/std/future: Likewise.
* include/std/memory: Remove headers that are not needed
directly, and are now inclkuded where they're needed. Include
new <bits/uses_allocator_args.h> header.
* include/std/memory_resource: Include only the necessary
headers. Use new feature test macro to detect support for the
utility functions.
* include/std/scoped_allocator: Likewise.
* include/std/version (__cpp_lib_make_obj_using_allocator):
Define.
Diffstat (limited to 'libstdc++-v3/include/std/condition_variable')
-rw-r--r-- | libstdc++-v3/include/std/condition_variable | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable index 1abec54..7406fde 100644 --- a/libstdc++-v3/include/std/condition_variable +++ b/libstdc++-v3/include/std/condition_variable @@ -39,10 +39,7 @@ #include <bits/std_mutex.h> #include <bits/unique_lock.h> -#include <ext/concurrence.h> #include <bits/alloc_traits.h> -#include <bits/allocator.h> -#include <bits/unique_ptr.h> #include <bits/shared_ptr.h> #include <bits/cxxabi_forced.h> |