Skip to content

Commit 35abfc6

Browse files
author
msebolt
committed
some revisions
1 parent cae5cdc commit 35abfc6

6 files changed

Lines changed: 184 additions & 140 deletions

File tree

‎docs/standard-library/bitset-class.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ A bit is set if its value is 1 and reset if its value is 0. To flip or invert a
7878
|[operator|=](#op_or_eq)|Performs a bitwise combination of bitsets with the inclusive `OR` operation.|
7979
|[operator~](#op_not)|Inverts all the bits in a target `bitset` and returns the result.|
8080
81+
### Structures
82+
83+
|Structure|Description|
84+
|-|-|
85+
|[hash](#hash)||
86+
8187
## Requirements
8288
8389
**Header:** \<bitset>
@@ -489,6 +495,13 @@ After flipping the fourth bit, the bitset becomes: ( 10001 )
489495
11111 The bit flipped is in position 4.
490496
```
491497

498+
## <a name="hash"></a> bitset::hash
499+
500+
```cpp
501+
template <class T> struct hash;
502+
template <size_t N> struct hash<bitset<N>>;
503+
```
504+
492505
## <a name="none"></a> bitset::none
493506
494507
Tests if no bit has been set to 1 in a bitset object.

‎docs/standard-library/climits.md‎

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,36 @@ ms.assetid: 7ca8a539-aa45-4ac3-86e8-74513be3f07e
77
---
88
# &lt;climits&gt;
99

10-
Includes the Standard C library header \<limits.h> and adds the associated names to the `std` namespace.
10+
Includes the C standard library header \<limits.h> and adds the associated names to the `std` namespace. Including this header ensures that the names declared using external linkage in the C standard library header are declared in the `std` namespace.
1111

1212
## Syntax
1313

1414
```cpp
1515
#include <climits>
1616
```
1717

18-
## Remarks
19-
20-
Including this header ensures that the names declared using external linkage in the Standard C library header are declared in the `std` namespace.
21-
22-
## Definitions
18+
## Macros
2319

2420
```cpp
25-
#define CHAR_BIT
26-
#define SCHAR_MIN
27-
#define SCHAR_MAX
28-
#define UCHAR_MAX
29-
#define CHAR_MIN
30-
#define CHAR_MAX
31-
#define MB_LEN_MAX
32-
#define SHRT_MIN
33-
#define SHRT_MAX
34-
#define USHRT_MAX
35-
#define INT_MIN
36-
#define INT_MAX
37-
#define UINT_MAX
38-
#define LONG_MIN
39-
#define LONG_MAX
40-
#define ULONG_MAX
41-
#define LLONG_MIN
42-
#define LLONG_MAX
43-
#define ULLONG_MAX
21+
#define CHAR_BIT
22+
#define SCHAR_MIN
23+
#define SCHAR_MAX
24+
#define UCHAR_MAX
25+
#define CHAR_MIN
26+
#define CHAR_MAX
27+
#define MB_LEN_MAX
28+
#define SHRT_MIN
29+
#define SHRT_MAX
30+
#define USHRT_MAX
31+
#define INT_MIN
32+
#define INT_MAX
33+
#define UINT_MAX
34+
#define LONG_MIN
35+
#define LONG_MAX
36+
#define ULONG_MAX
37+
#define LLONG_MIN
38+
#define LLONG_MAX
39+
#define ULLONG_MAX
4440
```
4541

4642
## See also

‎docs/standard-library/cstddef.md‎

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,68 @@ ms.assetid: be8d1e39-5974-41ee-b41d-eafa6c82ffce
77
---
88
# &lt;cstddef&gt;
99

10-
Includes the Standard C library header \<stddef.h> and adds the associated names to the `std` namespace.
10+
Includes the C standard library header \<stddef.h> and adds associated names to the `std` namespace. Including this header ensures that the names declared using external linkage in the C standard library header are declared in the `std` namespace.
1111

1212
> [!NOTE]
13-
> `cstddef` doesn't include **wchar_t** but does include the type **byte**.
13+
> \<cstddef> includes type **byte** and doesn't include type **wchar_t**.
1414
1515
## Syntax
1616

1717
```cpp
18-
#include <cstddef>
18+
#include <cstddef>
1919
```
2020

21-
## Types
21+
## Namespace and Macros
2222

2323
```cpp
24-
ptrdiff_t = see below;
25-
using size_t = see below;
26-
using max_align_t = see below;
24+
namespace std {
25+
using ptrdiff_t = see definition;
26+
using size_t = see definition;
27+
using max_align_t = see definition;
2728
using nullptr_t = decltype(nullptr);
29+
}
30+
31+
#define NULL // an implementation-defined null pointer constant
32+
#define offsetof(type, member-designator)
2833
```
2934
30-
## Enums
35+
### Parameters
3136
32-
```cpp
33-
enum class byte : unsigned char {};
34-
```
37+
*ptrdiff_t*<br/>
38+
An implementation-defined signed integer type that can hold the difference of two subscripts in an array object.
3539
36-
## Operators
40+
*size_t*<br/>
41+
An implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object.
3742
38-
```cpp
39-
template <class IntType> byte& operator<<=(byte& b, IntType shift)
40-
template <class IntType> byte operator<<(byte b, IntType shift) noexcept;
41-
template <class IntType> byte& operator>>=(byte& b, IntType shift) noexcept;
42-
template <class IntType> byte operator>>(byte b, IntType shift) noexcept;
43-
byte& operator|=(byte& l, byte r) noexcept;
44-
byte operator|(byte l, byte r) noexcept;
45-
byte& operator&=(byte& l, byte r) noexcept;
46-
byte operator&(byte l, byte r) noexcept;
47-
byte& operator^=(byte& l, byte r) noexcept;
48-
byte operator^(byte l, byte r) noexcept;
49-
byte operator~(byte b) noexcept;
50-
```
43+
*max_align_t*<br/>
44+
A POD type whose alignment requirement is at least as great as that of every scalar type, and whose alignment requirement is supported in every context.
45+
46+
*nullptr_t*<br/>
47+
A synonym for the type of a **nullptr** expression. Although a **nullptr** address can't be taken, the address of another *nullptr_t* object that is an lvalue can be taken.
5148
52-
## Functions
49+
## byte Class
5350
5451
```cpp
55-
template <class IntType> IntType to_integer(byte b) noexcept;
52+
enum class byte : unsigned char {};
53+
54+
template <class IntType>
55+
constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
56+
constexpr byte operator<<(byte b, IntType shift) noexcept;
57+
constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
58+
constexpr byte operator>>(byte b, IntType shift) noexcept;
59+
60+
constexpr byte& operator|=(byte& left, byte right) noexcept;
61+
constexpr byte operator|(byte left, byte right) noexcept;
62+
constexpr byte& operator&=(byte& left, byte right) noexcept;
63+
constexpr byte operator&(byte left, byte right) noexcept;
64+
constexpr byte& operator^=(byte& left, byte right) noexcept;
65+
constexpr byte operator^(byte left, byte right) noexcept;
66+
constexpr byte operator~(byte b) noexcept;
67+
68+
template <class IntType>
69+
IntType to_integer(byte b) noexcept;
5670
```
5771

58-
## Remarks
59-
60-
Including this header ensures that the names declared using external linkage in the Standard C library header are declared in the `std` namespace.
61-
6272
## See also
6373

6474
[Header Files Reference](../standard-library/cpp-standard-library-header-files.md)<br/>

‎docs/standard-library/cstdlib.md‎

Lines changed: 80 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,124 +7,123 @@ ms.assetid: 0a6aaebf-84e9-4b60-ae90-17e11981cf54
77
---
88
# &lt;cstdlib&gt;
99

10-
Includes the Standard C library header \<stdlib.h> and adds the associated names to the `std` namespace.
10+
Includes the Standard C library header \<stdlib.h> and adds the associated names to the `std` namespace. Including this header ensures that the names declared using external linkage in the C standard library header are declared in the `std` namespace.
11+
12+
> [!NOTE]
13+
> \<stdlib.h> doesn't include the type **wchar_t**.
1114
1215
## Syntax
1316

1417
```cpp
1518
#include <cstdlib>
1619
```
1720

18-
## Remarks
19-
20-
Including this header ensures that the names declared using external linkage in the Standard C library header are declared in the `std` namespace.
21-
22-
## Types
21+
## Namespace and Macros
2322

2423
```cpp
25-
using size_t = see below;
26-
using div_t = see below;
27-
using ldiv_t = see below;
28-
using lldiv_t = see below;
24+
namespace std {
25+
using size_t = see definition;
26+
using div_t = see definition;
27+
using ldiv_t = see definition;
28+
using lldiv_t = see definition;
29+
}
30+
31+
#define NULL
32+
#define EXIT_FAILURE
33+
#define EXIT_SUCCESS
34+
#define RAND_MAX
35+
#define MB_CUR_MAX
2936
```
3037
31-
## Definitions
38+
## Functions
39+
40+
### Exposition only
3241
3342
```cpp
34-
#define NULL
35-
#define EXIT_FAILURE
36-
#define EXIT_SUCCESS
37-
#define RAND_MAX
38-
#define MB_CUR_MAX
43+
extern "C" using c-atexit-handler = void();
44+
extern "C++" using atexit-handler = void();
45+
extern "C" using c-compare-pred = int(const void*, const void*);
46+
extern "C++" using compare-pred = int(const void*, const void*);
3947
```
4048

41-
## Functions
49+
### Start and termination
4250

4351
```cpp
44-
function type aliases extern "C"
45-
using c-atexit-handler = void();
46-
using atexit-handler = void();
47-
using c-compare-pred = int(const void*, const void*);
48-
using compare-pred = int(const void*, const void*);
52+
[[noreturn]] void abort() noexcept;
53+
int atexit(c-atexit-handler * func) noexcept;
54+
int atexit(atexit-handler * func) noexcept;
55+
int at_quick_exit(c-atexit-handler * func) noexcept;
56+
int at_quick_exit(atexit-handler * func) noexcept;
57+
[[noreturn]] void exit(int status);
58+
[[noreturn]] void _Exit(int status) noexcept;
59+
[[noreturn]] void quick_exit(int status) noexcept;
60+
char* getenv(const char* name);
61+
int system(const char* string);
4962
```
5063
51-
### Start and Termination
64+
### C library memory allocation
5265
5366
```cpp
54-
void abort() noexcept;
55-
int atexit(c-atexit-handler* func) noexcept;
56-
int atexit(atexit-handler* func) noexcept;
57-
int at_quick_exit(c-atexit-handler* func) noexcept;
58-
int at_quick_exit(atexit-handler* func) noexcept;
59-
void exit(int status);
60-
void _Exit(int status) noexcept;
61-
void quick_exit(int status) noexcept;
62-
63-
char* getenv(const char* name);
64-
int system(const char* string);
65-
66-
void* aligned_alloc(size_t alignment, size_t size);
67-
void* calloc(size_t nmemb, size_t size);
68-
void free(void* ptr);
69-
void* malloc(size_t size);
70-
void* realloc(void* ptr, size_t size);
71-
72-
double atof(const char* nptr);
73-
int atoi(const char* nptr);
74-
long int atol(const char* nptr);
75-
long long int atoll(const char* nptr);
76-
77-
double strtod(const char* nptr, char** endptr);
78-
float strtof(const char* nptr, char** endptr);
79-
long double strtold(const char* nptr, char** endptr);
80-
long int strtol(const char* nptr, char** endptr, int base);
81-
long long int strtoll(const char* nptr, char** endptr, int base);
82-
unsigned long int strtoul(const char* nptr, char** endptr, int base);
83-
unsigned long long int strtoull(const char* nptr, char** endptr, int base);
67+
void* aligned_alloc(size_t alignment, size_t size);
68+
void* calloc(size_t nmemb, size_t size);
69+
void free(void* ptr);
70+
void* malloc(size_t size);
71+
void* realloc(void* ptr, size_t size);
72+
double atof(const char* nptr);
73+
int atoi(const char* nptr);
74+
long int atol(const char* nptr);
75+
long long int atoll(const char* nptr);
76+
double strtod(const char* nptr, char** endptr);
77+
float strtof(const char* nptr, char** endptr);
78+
long double strtold(const char* nptr, char** endptr);
79+
long int strtol(const char* nptr, char** endptr, int base);
80+
long long int strtoll(const char* nptr, char** endptr, int base);
81+
unsigned long int strtoul(const char* nptr, char** endptr, int base);
82+
unsigned long long int strtoull(const char* nptr, char** endptr, int base);
8483
```
8584

86-
### Multibyte / Wide String and Character Conversion
85+
### Multibyte / wide string and character conversion
8786

8887
```cpp
89-
int mblen(const char* s, size_t n);
90-
int mbtowc(wchar_t* pwc, const char* s, size_t n);
91-
int wctomb(char* s, wchar_t wchar);
92-
size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
93-
size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);
88+
int mblen(const char* s, size_t n);
89+
int mbtowc(wchar_t* pwc, const char* s, size_t n);
90+
int wctomb(char* s, wchar_t wchar);
91+
size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
92+
size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);
9493
```
9594
96-
### C Standard Library Algorithms
95+
### C standard library algorithms
9796
9897
```cpp
99-
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, c-compare-pred* compar);
100-
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, compare-pred* compar);
101-
void qsort(void* base, size_t nmemb, size_t size, c-compare-pred* compar);
102-
void qsort(void* base, size_t nmemb, size_t size, compare-pred* compar);
98+
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, c-compare-pred * compar);
99+
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, compare-pred * compar);
100+
void qsort(void* base, size_t nmemb, size_t size, c-compare-pred * compar);
101+
void qsort(void* base, size_t nmemb, size_t size, compare-pred * compar);
103102
```
104103

105-
### Low-quality Random Number Generation
104+
### Low-quality random number generation
106105

107106
```cpp
108-
int rand();
109-
void srand(unsigned int seed);
107+
int rand();
108+
void srand(unsigned int seed);
110109
```
111110
112-
### Absolute Values
111+
### Absolute values
113112
114113
```cpp
115-
int abs(int j);
116-
long int abs(long int j);
117-
long long int abs(long long int j);
118-
float abs(float j);
119-
double abs(double j);
120-
long double abs(long double j);
121-
long int labs(long int j);
122-
long long int llabs(long long int j);
123-
div_t div(int numer, int denom);
124-
ldiv_t div(long int numer, long int denom);
125-
lldiv_t div(long long int numer, long long int denom);
126-
ldiv_t ldiv(long int numer, long int denom);
127-
lldiv_t lldiv(long long int numer, long long int denom);
114+
int abs(int j);
115+
long int abs(long int j);
116+
long long int abs(long long int j);
117+
float abs(float j);
118+
double abs(double j);
119+
long double abs(long double j);
120+
long int labs(long int j);
121+
long long int llabs(long long int j);
122+
div_t div(int numer, int denom);
123+
ldiv_t div(long int numer, long int denom);
124+
lldiv_t div(long long int numer, long long int denom);
125+
ldiv_t ldiv(long int numer, long int denom);
126+
lldiv_t lldiv(long long int numer, long long int denom);
128127
```
129128

130129
## See also

0 commit comments

Comments
 (0)