libstdc++: memoryfwd.h Source File

libstdc++

memoryfwd.h
Go to the documentation of this file.
1// <memory> Forward declarations -*- C++ -*-
2
3// Copyright (C) 2001-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/*
26 * Copyright (c) 1996-1997
27 * Silicon Graphics Computer Systems, Inc.
28 *
29 * Permission to use, copy, modify, distribute and sell this software
30 * and its documentation for any purpose is hereby granted without fee,
31 * provided that the above copyright notice appear in all copies and
32 * that both that copyright notice and this permission notice appear
33 * in supporting documentation. Silicon Graphics makes no
34 * representations about the suitability of this software for any
35 * purpose. It is provided "as is" without express or implied warranty.
36 */
37
38/** @file bits/memoryfwd.h
39 * This is an internal header file, included by other library headers.
40 * Do not attempt to use it directly. @headername{memory}
41 */
42
43#ifndef _MEMORYFWD_H
44#define _MEMORYFWD_H 1
45
46#ifdef _GLIBCXX_SYSHDR
47#pragma GCC system_header
48#endif
49
50#include <bits/c++config.h>
51#include <bits/version.h>
52
53namespace std _GLIBCXX_VISIBILITY(default)
54{
55_GLIBCXX_BEGIN_NAMESPACE_VERSION
56
57 /**
58 * @defgroup allocators Allocators
59 * @ingroup memory
60 *
61 * Classes encapsulating memory operations.
62 *
63 * @{
64 */
65
66 // Included in freestanding as a libstdc++ extension.
67 template<typename>
68 class allocator;
69
70 template<>
71 class allocator<void>;
72
73#if __cplusplus >= 201103L
74 /// Declare uses_allocator so it can be specialized in `<queue>` etc.
75 template<typename, typename>
76 struct uses_allocator;
77
78 template<typename>
79 struct allocator_traits;
80#endif
81
82#ifdef __glibcxx_allocate_at_least // C++23
83 // Result of, specifically, allocate_at_least(). `count` is the number
84 // of objects that may be indexed from `ptr`, not bytes.
85 template <typename _Pointer, typename _Size = size_t>
86 struct allocation_result
87 {
88 _Pointer ptr;
89 _Size count;
90 };
91#endif
92
93
94 /// @} group memory
95
96_GLIBCXX_END_NAMESPACE_VERSION
97} // namespace std
98
99#endif
version.h
c++config.h
std
ISO C++ entities toplevel namespace is std.
std::allocator_traits
Uniform interface to all allocator types.
Definition bits/alloc_traits.h:250
std::allocator
The standard allocator, as per C++03 [20.4.1].
Definition allocator.h:134
std::uses_allocator
Declare uses_allocator so it can be specialized in <queue> etc.
Definition memoryfwd.h:76