tmp/tmpytpyyefd/{from.md → to.md}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
## Common definitions <a id="support.types">[[support.types]]</a>
|
| 2 |
|
| 3 |
### Header `<cstddef>` synopsis <a id="cstddef.syn">[[cstddef.syn]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
|
|
|
| 6 |
namespace std {
|
| 7 |
using ptrdiff_t = see below;
|
| 8 |
using size_t = see below;
|
| 9 |
using max_align_t = see below;
|
| 10 |
using nullptr_t = decltype(nullptr);
|
|
@@ -45,17 +46,17 @@ See also: ISO C 7.19
|
|
| 45 |
|
| 46 |
### Header `<cstdlib>` synopsis <a id="cstdlib.syn">[[cstdlib.syn]]</a>
|
| 47 |
|
| 48 |
``` cpp
|
| 49 |
namespace std {
|
| 50 |
-
using size_t = see below;
|
| 51 |
using div_t = see below;
|
| 52 |
using ldiv_t = see below;
|
| 53 |
using lldiv_t = see below;
|
| 54 |
}
|
| 55 |
|
| 56 |
-
#define NULL see below
|
| 57 |
#define EXIT_FAILURE see below
|
| 58 |
#define EXIT_SUCCESS see below
|
| 59 |
#define RAND_MAX see below
|
| 60 |
#define MB_CUR_MAX see below
|
| 61 |
|
|
@@ -65,18 +66,18 @@ namespace std {
|
|
| 65 |
extern "C++" using atexit-handler = void(); // exposition only
|
| 66 |
extern "C" using c-compare-pred = int(const void*, const void*); // exposition only
|
| 67 |
extern "C++" using compare-pred = int(const void*, const void*); // exposition only
|
| 68 |
|
| 69 |
// [support.start.term], start and termination
|
| 70 |
-
[[noreturn]] void abort() noexcept;
|
| 71 |
-
int atexit(c-atexit-handler* func) noexcept;
|
| 72 |
-
int atexit(atexit-handler* func) noexcept;
|
| 73 |
-
int at_quick_exit(c-atexit-handler* func) noexcept;
|
| 74 |
-
int at_quick_exit(atexit-handler* func) noexcept;
|
| 75 |
-
[[noreturn]] void exit(int status);
|
| 76 |
-
[[noreturn]] void _Exit(int status) noexcept;
|
| 77 |
-
[[noreturn]] void quick_exit(int status) noexcept;
|
| 78 |
|
| 79 |
char* getenv(const char* name);
|
| 80 |
int system(const char* string);
|
| 81 |
|
| 82 |
// [c.malloc], C library memory allocation
|
|
@@ -116,25 +117,23 @@ namespace std {
|
|
| 116 |
// [c.math.rand], low-quality random number generation
|
| 117 |
int rand();
|
| 118 |
void srand(unsigned int seed);
|
| 119 |
|
| 120 |
// [c.math.abs], absolute values
|
| 121 |
-
int abs(int j);
|
| 122 |
-
long int abs(long int j);
|
| 123 |
-
long long int abs(long long int j);
|
| 124 |
-
|
| 125 |
-
double abs(double j);
|
| 126 |
-
long double abs(long double j);
|
| 127 |
|
| 128 |
-
long int labs(long int j);
|
| 129 |
-
long long int llabs(long long int j);
|
| 130 |
|
| 131 |
-
div_t div(int numer, int denom);
|
| 132 |
-
ldiv_t div(long int numer, long int denom);
|
| 133 |
-
lldiv_t div(long long int numer, long long int denom);
|
| 134 |
-
ldiv_t ldiv(long int numer, long int denom);
|
| 135 |
-
lldiv_t lldiv(long long int numer, long long int denom);
|
| 136 |
}
|
| 137 |
```
|
| 138 |
|
| 139 |
The contents and meaning of the header `<cstdlib>` are the same as the C
|
| 140 |
standard library header `<stdlib.h>`, except that it does not declare
|
|
@@ -156,41 +155,43 @@ expression, and it has the characteristics described in
|
|
| 156 |
|
| 157 |
[*Note 1*: Although `nullptr`’s address cannot be taken, the address of
|
| 158 |
another `nullptr_t` object that is an lvalue can be
|
| 159 |
taken. — *end note*]
|
| 160 |
|
| 161 |
-
The macro `NULL` is an *implementation-defined* null pointer
|
| 162 |
-
[^1]
|
| 163 |
|
| 164 |
See also: ISO C 7.19
|
| 165 |
|
| 166 |
### Sizes, alignments, and offsets <a id="support.types.layout">[[support.types.layout]]</a>
|
| 167 |
|
| 168 |
The macro `offsetof(type, member-designator)` has the same semantics as
|
| 169 |
the corresponding macro in the C standard library header `<stddef.h>`,
|
| 170 |
but accepts a restricted set of `type` arguments in this document. Use
|
| 171 |
of the `offsetof` macro with a `type` other than a standard-layout class
|
| 172 |
-
[[class.prop]] is conditionally-supported.[^2]
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
| 179 |
|
| 180 |
The type `ptrdiff_t` is an *implementation-defined* signed integer type
|
| 181 |
that can hold the difference of two subscripts in an array object, as
|
| 182 |
described in [[expr.add]].
|
| 183 |
|
| 184 |
The type `size_t` is an *implementation-defined* unsigned integer type
|
| 185 |
that is large enough to contain the size in bytes of any object
|
| 186 |
[[expr.sizeof]].
|
| 187 |
|
| 188 |
-
|
| 189 |
`ptrdiff_t` and `size_t` whose integer conversion ranks [[conv.rank]]
|
| 190 |
are no greater than that of `signed long int` unless a larger size is
|
| 191 |
-
necessary to contain all the possible values.
|
| 192 |
|
| 193 |
The type `max_align_t` is a trivial standard-layout type whose alignment
|
| 194 |
requirement is at least as great as that of every scalar type, and whose
|
| 195 |
alignment requirement is supported in every context [[basic.align]].
|
| 196 |
|
|
|
|
| 1 |
## Common definitions <a id="support.types">[[support.types]]</a>
|
| 2 |
|
| 3 |
### Header `<cstddef>` synopsis <a id="cstddef.syn">[[cstddef.syn]]</a>
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
+
// all freestanding
|
| 7 |
namespace std {
|
| 8 |
using ptrdiff_t = see below;
|
| 9 |
using size_t = see below;
|
| 10 |
using max_align_t = see below;
|
| 11 |
using nullptr_t = decltype(nullptr);
|
|
|
|
| 46 |
|
| 47 |
### Header `<cstdlib>` synopsis <a id="cstdlib.syn">[[cstdlib.syn]]</a>
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
namespace std {
|
| 51 |
+
using size_t = see below; // freestanding
|
| 52 |
using div_t = see below;
|
| 53 |
using ldiv_t = see below;
|
| 54 |
using lldiv_t = see below;
|
| 55 |
}
|
| 56 |
|
| 57 |
+
#define NULL see below // freestanding
|
| 58 |
#define EXIT_FAILURE see below
|
| 59 |
#define EXIT_SUCCESS see below
|
| 60 |
#define RAND_MAX see below
|
| 61 |
#define MB_CUR_MAX see below
|
| 62 |
|
|
|
|
| 66 |
extern "C++" using atexit-handler = void(); // exposition only
|
| 67 |
extern "C" using c-compare-pred = int(const void*, const void*); // exposition only
|
| 68 |
extern "C++" using compare-pred = int(const void*, const void*); // exposition only
|
| 69 |
|
| 70 |
// [support.start.term], start and termination
|
| 71 |
+
[[noreturn]] void abort() noexcept; // freestanding
|
| 72 |
+
int atexit(c-atexit-handler* func) noexcept; // freestanding
|
| 73 |
+
int atexit(atexit-handler* func) noexcept; // freestanding
|
| 74 |
+
int at_quick_exit(c-atexit-handler* func) noexcept; // freestanding
|
| 75 |
+
int at_quick_exit(atexit-handler* func) noexcept; // freestanding
|
| 76 |
+
[[noreturn]] void exit(int status); // freestanding
|
| 77 |
+
[[noreturn]] void _Exit(int status) noexcept; // freestanding
|
| 78 |
+
[[noreturn]] void quick_exit(int status) noexcept; // freestanding
|
| 79 |
|
| 80 |
char* getenv(const char* name);
|
| 81 |
int system(const char* string);
|
| 82 |
|
| 83 |
// [c.malloc], C library memory allocation
|
|
|
|
| 117 |
// [c.math.rand], low-quality random number generation
|
| 118 |
int rand();
|
| 119 |
void srand(unsigned int seed);
|
| 120 |
|
| 121 |
// [c.math.abs], absolute values
|
| 122 |
+
constexpr int abs(int j);
|
| 123 |
+
constexpr long int abs(long int j);
|
| 124 |
+
constexpr long long int abs(long long int j);
|
| 125 |
+
constexpr floating-point-type abs(floating-point-type j);
|
|
|
|
|
|
|
| 126 |
|
| 127 |
+
constexpr long int labs(long int j);
|
| 128 |
+
constexpr long long int llabs(long long int j);
|
| 129 |
|
| 130 |
+
constexpr div_t div(int numer, int denom);
|
| 131 |
+
constexpr ldiv_t div(long int numer, long int denom); // see [library.c]
|
| 132 |
+
constexpr lldiv_t div(long long int numer, long long int denom); // see [library.c]
|
| 133 |
+
constexpr ldiv_t ldiv(long int numer, long int denom);
|
| 134 |
+
constexpr lldiv_t lldiv(long long int numer, long long int denom);
|
| 135 |
}
|
| 136 |
```
|
| 137 |
|
| 138 |
The contents and meaning of the header `<cstdlib>` are the same as the C
|
| 139 |
standard library header `<stdlib.h>`, except that it does not declare
|
|
|
|
| 155 |
|
| 156 |
[*Note 1*: Although `nullptr`’s address cannot be taken, the address of
|
| 157 |
another `nullptr_t` object that is an lvalue can be
|
| 158 |
taken. — *end note*]
|
| 159 |
|
| 160 |
+
The macro `NULL` is an *implementation-defined* null pointer
|
| 161 |
+
constant.[^1]
|
| 162 |
|
| 163 |
See also: ISO C 7.19
|
| 164 |
|
| 165 |
### Sizes, alignments, and offsets <a id="support.types.layout">[[support.types.layout]]</a>
|
| 166 |
|
| 167 |
The macro `offsetof(type, member-designator)` has the same semantics as
|
| 168 |
the corresponding macro in the C standard library header `<stddef.h>`,
|
| 169 |
but accepts a restricted set of `type` arguments in this document. Use
|
| 170 |
of the `offsetof` macro with a `type` other than a standard-layout class
|
| 171 |
+
[[class.prop]] is conditionally-supported.[^2]
|
| 172 |
+
|
| 173 |
+
The expression `offsetof(type, member-designator)` is never
|
| 174 |
+
type-dependent [[temp.dep.expr]] and it is value-dependent
|
| 175 |
+
[[temp.dep.constexpr]] if and only if `type` is dependent. The result of
|
| 176 |
+
applying the `offsetof` macro to a static data member or a function
|
| 177 |
+
member is undefined. No operation invoked by the `offsetof` macro shall
|
| 178 |
+
throw an exception and `noexcept(offsetof(type, member-designator))`
|
| 179 |
+
shall be `true`.
|
| 180 |
|
| 181 |
The type `ptrdiff_t` is an *implementation-defined* signed integer type
|
| 182 |
that can hold the difference of two subscripts in an array object, as
|
| 183 |
described in [[expr.add]].
|
| 184 |
|
| 185 |
The type `size_t` is an *implementation-defined* unsigned integer type
|
| 186 |
that is large enough to contain the size in bytes of any object
|
| 187 |
[[expr.sizeof]].
|
| 188 |
|
| 189 |
+
*Recommended practice:* An implementation should choose types for
|
| 190 |
`ptrdiff_t` and `size_t` whose integer conversion ranks [[conv.rank]]
|
| 191 |
are no greater than that of `signed long int` unless a larger size is
|
| 192 |
+
necessary to contain all the possible values.
|
| 193 |
|
| 194 |
The type `max_align_t` is a trivial standard-layout type whose alignment
|
| 195 |
requirement is at least as great as that of every scalar type, and whose
|
| 196 |
alignment requirement is supported in every context [[basic.align]].
|
| 197 |
|