2003-03-14 23:16:06 +01:00
|
|
|
// C++ includes used for precompiling -*- C++ -*-
|
|
|
|
|
2020-01-01 12:51:42 +01:00
|
|
|
// Copyright (C) 2003-2020 Free Software Foundation, Inc.
|
2003-03-14 23:16:06 +01:00
|
|
|
//
|
|
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
|
// software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU General Public License as published by the
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2003-03-14 23:16:06 +01:00
|
|
|
// any later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
2003-03-14 23:16:06 +01:00
|
|
|
|
2006-12-06 00:24:07 +01:00
|
|
|
/** @file stdc++.h
|
|
|
|
* This is an implementation file for a precompiled header.
|
|
|
|
*/
|
|
|
|
|
2003-03-14 23:16:06 +01:00
|
|
|
// 17.4.1.2 Headers
|
|
|
|
|
|
|
|
// C
|
2009-08-12 02:56:12 +02:00
|
|
|
#ifndef _GLIBCXX_NO_ASSERT
|
2003-03-14 23:16:06 +01:00
|
|
|
#include <cassert>
|
2009-08-12 02:56:12 +02:00
|
|
|
#endif
|
2003-03-14 23:16:06 +01:00
|
|
|
#include <cctype>
|
|
|
|
#include <cerrno>
|
|
|
|
#include <cfloat>
|
|
|
|
#include <ciso646>
|
|
|
|
#include <climits>
|
|
|
|
#include <clocale>
|
|
|
|
#include <cmath>
|
|
|
|
#include <csetjmp>
|
|
|
|
#include <csignal>
|
|
|
|
#include <cstdarg>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
|
|
|
#include <ctime>
|
2018-06-18 18:42:11 +02:00
|
|
|
#include <cwchar>
|
|
|
|
#include <cwctype>
|
2003-03-14 23:16:06 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <ccomplex>
|
|
|
|
#include <cfenv>
|
|
|
|
#include <cinttypes>
|
2011-11-08 02:02:06 +01:00
|
|
|
#include <cstdalign>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <cstdbool>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <ctgmath>
|
2015-09-04 13:13:34 +02:00
|
|
|
#include <cuchar>
|
2007-12-10 01:38:36 +01:00
|
|
|
#endif
|
|
|
|
|
2003-03-14 23:16:06 +01:00
|
|
|
// C++
|
|
|
|
#include <algorithm>
|
|
|
|
#include <bitset>
|
|
|
|
#include <complex>
|
|
|
|
#include <deque>
|
|
|
|
#include <exception>
|
|
|
|
#include <fstream>
|
|
|
|
#include <functional>
|
|
|
|
#include <iomanip>
|
|
|
|
#include <ios>
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <iostream>
|
|
|
|
#include <istream>
|
|
|
|
#include <iterator>
|
|
|
|
#include <limits>
|
|
|
|
#include <list>
|
|
|
|
#include <locale>
|
|
|
|
#include <map>
|
|
|
|
#include <memory>
|
|
|
|
#include <new>
|
|
|
|
#include <numeric>
|
|
|
|
#include <ostream>
|
|
|
|
#include <queue>
|
|
|
|
#include <set>
|
|
|
|
#include <sstream>
|
|
|
|
#include <stack>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <streambuf>
|
|
|
|
#include <string>
|
|
|
|
#include <typeinfo>
|
|
|
|
#include <utility>
|
|
|
|
#include <valarray>
|
|
|
|
#include <vector>
|
2007-12-10 01:38:36 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <array>
|
2009-12-21 20:00:34 +01:00
|
|
|
#include <atomic>
|
2008-07-16 01:23:23 +02:00
|
|
|
#include <chrono>
|
2015-06-12 14:27:06 +02:00
|
|
|
#include <codecvt>
|
2009-04-07 03:46:45 +02:00
|
|
|
#include <condition_variable>
|
2008-10-15 18:48:13 +02:00
|
|
|
#include <forward_list>
|
2009-08-11 06:30:35 +02:00
|
|
|
#include <future>
|
2009-10-13 13:26:06 +02:00
|
|
|
#include <initializer_list>
|
2009-04-07 03:46:45 +02:00
|
|
|
#include <mutex>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <random>
|
2008-07-16 01:23:23 +02:00
|
|
|
#include <ratio>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <regex>
|
2011-07-20 17:45:55 +02:00
|
|
|
#include <scoped_allocator>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <system_error>
|
2009-04-07 03:46:45 +02:00
|
|
|
#include <thread>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <tuple>
|
2010-09-22 14:04:08 +02:00
|
|
|
#include <typeindex>
|
2007-12-10 01:38:36 +01:00
|
|
|
#include <type_traits>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <unordered_set>
|
|
|
|
#endif
|
2015-06-12 14:27:06 +02:00
|
|
|
|
|
|
|
#if __cplusplus >= 201402L
|
|
|
|
#include <shared_mutex>
|
|
|
|
#endif
|
2017-10-02 16:06:40 +02:00
|
|
|
|
2017-10-23 14:11:22 +02:00
|
|
|
#if __cplusplus >= 201703L
|
2018-06-18 18:42:11 +02:00
|
|
|
#include <any>
|
2017-10-02 16:06:40 +02:00
|
|
|
#include <charconv>
|
2018-06-18 18:42:11 +02:00
|
|
|
// #include <execution>
|
2017-10-23 14:11:22 +02:00
|
|
|
#include <filesystem>
|
2018-06-18 18:42:11 +02:00
|
|
|
#include <optional>
|
Add initial version of C++17 <memory_resource> header
This is missing the synchronized_pool_resource and
unsynchronized_pool_resource classes but is otherwise complete.
This is a new implementation, not based on the existing code in
<experimental/memory_resource>, but memory_resource and
polymorphic_allocator ended up looking almost the same anyway.
The constant_init kluge in src/c++17/memory_resource.cc is apparently
due to Richard Smith and ensures that the objects are constructed during
constant initialiation phase and not destroyed (because the
constant_init destructor doesn't destroy the union member and the
storage is not reused).
* config/abi/pre/gnu.ver: Export new symbols.
* configure: Regenerate.
* include/Makefile.am: Add new <memory_resource> header.
* include/Makefile.in: Regenerate.
* include/precompiled/stdc++.h: Include <memory_resource> for C++17.
* include/std/memory_resource: New header.
(memory_resource, polymorphic_allocator, new_delete_resource)
(null_memory_resource, set_default_resource, get_default_resource)
(pool_options, monotonic_buffer_resource): Define.
* src/Makefile.am: Add c++17 directory.
* src/Makefile.in: Regenerate.
* src/c++11/Makefile.am: Fix comment.
* src/c++17/Makefile.am: Add makefile for new sub-directory.
* src/c++17/Makefile.in: Generate.
* src/c++17/memory_resource.cc: New.
(newdel_res_t, null_res_t, constant_init, newdel_res, null_res)
(default_res, new_delete_resource, null_memory_resource)
(set_default_resource, get_default_resource): Define.
* testsuite/20_util/memory_resource/1.cc: New test.
* testsuite/20_util/memory_resource/2.cc: New test.
* testsuite/20_util/monotonic_buffer_resource/1.cc: New test.
* testsuite/20_util/monotonic_buffer_resource/allocate.cc: New test.
* testsuite/20_util/monotonic_buffer_resource/deallocate.cc: New test.
* testsuite/20_util/monotonic_buffer_resource/release.cc: New test.
* testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc:
New test.
* testsuite/20_util/polymorphic_allocator/1.cc: New test.
* testsuite/20_util/polymorphic_allocator/resource.cc: New test.
* testsuite/20_util/polymorphic_allocator/select.cc: New test.
* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
Define concrete memory resource for testing.
(__gnu_test::default_resource_mgr): Define RAII helper for changing
default resource.
From-SVN: r262953
2018-07-24 23:09:55 +02:00
|
|
|
#include <memory_resource>
|
2018-06-18 18:42:11 +02:00
|
|
|
#include <string_view>
|
|
|
|
#include <variant>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if __cplusplus > 201703L
|
P0556R3 Integral power-of-2 operations, P0553R2 Bit operations
P0553R2 is not in the C++2a working draft yet, but is likely to be
approved soon. Neither proposal supports std::byte but this adds
overloads of each function for std::byte, assuming that will also get
added.
* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/precompiled/stdc++.h: Include new header.
* include/std/bit: New header.
(__rotl, __rotr, __countl_zero, __countl_one, __countr_zero)
(__countr_one, __popcount, __ispow2, __ceil2, __floor2, __log2p1):
Define for C++14.
[!__STRICT_ANSI__] (rotl, rotr, countl_zero, countl_one, countr_zero)
(countr_one, popcount): Define for C++2a. Also overload for std::byte.
(ispow2, ceil2, floor2, log2p1): Define for C++2a.
[!__STRICT_ANSI__] (ispow2, ceil2, floor2, log2p1): Overload for
std::byte.
* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: New.
* testsuite/26_numerics/bit/bit.pow.two/floor2.cc: New.
* testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: New.
* testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: New.
* testsuite/26_numerics/bit/bitops.rot/rotl.cc: New.
* testsuite/26_numerics/bit/bitops.rot/rotr.cc: New.
* testsuite/26_numerics/bit/bitops.count/countl_one.cc: New.
* testsuite/26_numerics/bit/bitops.count/countl_zero.cc: New.
* testsuite/26_numerics/bit/bitops.count/countr_one.cc: New.
* testsuite/26_numerics/bit/bitops.count/countr_zero.cc: New.
From-SVN: r262360
2018-07-03 23:04:45 +02:00
|
|
|
#include <bit>
|
2019-11-08 01:37:17 +01:00
|
|
|
#include <compare>
|
2019-10-11 17:53:52 +02:00
|
|
|
#include <concepts>
|
2019-07-31 18:40:39 +02:00
|
|
|
#include <numbers>
|
2019-10-31 22:42:18 +01:00
|
|
|
#include <ranges>
|
2019-10-04 14:16:56 +02:00
|
|
|
#include <span>
|
2019-11-15 15:38:59 +01:00
|
|
|
#include <stop_token>
|
2018-06-18 18:42:11 +02:00
|
|
|
// #include <syncstream>
|
|
|
|
#include <version>
|
2017-10-02 16:06:40 +02:00
|
|
|
#endif
|