Skip to content

Commit f293f07

Browse files
author
Colin Robertson
committed
More TR1 F1 fixes
1 parent c7f3b34 commit f293f07

27 files changed

+327
-246
lines changed

docs/standard-library/1-object.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ f1_keywords:
1212
- "_1"
1313
- "std::_1"
1414
- "functional/std::_1"
15-
- "std::tr1::_1"
16-
- "functional/std::tr1::_1"
1715
dev_langs:
1816
- "C++"
1917
helpviewer_keywords:

docs/standard-library/add-const-class.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ f1_keywords:
1212
- "add_const"
1313
- "std::add_const"
1414
- "type_traits/std::add_const"
15-
- "tr1::add_const"
16-
- "std::tr1::add_const"
17-
- "type_traits/std::tr1::add_const"
1815
dev_langs:
1916
- "C++"
2017
helpviewer_keywords:
21-
- "add_const class [TR1]"
18+
- "add_const class"
2219
- "add_const"
2320
ms.assetid: 1262a1eb-8c9c-4dd6-9f43-88ba280182f1
2421
caps.latest.revision: 19
@@ -60,22 +57,21 @@ struct add_const;
6057
## Example
6158

6259
```cpp
63-
// std_tr1__type_traits__add_const.cpp
60+
// std__type_traits__add_const.cpp
6461
// compile with: /EHsc
6562
#include <type_traits>
6663
#include <iostream>
6764

6865
int main()
69-
{
66+
{
7067
std::add_const<int>::type *p = (const int *)0;
7168

7269
p = p; // to quiet "unused" warning
7370
std::cout << "add_const<int> == "
7471
<< typeid(*p).name() << std::endl;
7572

7673
return (0);
77-
}
78-
74+
}
7975
```
8076

8177
```Output

docs/standard-library/add-cv-class.md

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ f1_keywords:
1212
- "add_cv"
1313
- "std::add_cv"
1414
- "type_traits/std::add_cv"
15-
- "tr1::add_cv"
16-
- "std::tr1::add_cv"
17-
- "type_traits/std::tr1::add_cv"
1815
dev_langs:
1916
- "C++"
2017
helpviewer_keywords:
21-
- "add_cv class [TR1]"
18+
- "add_cv class"
2219
- "add_cv"
2320
ms.assetid: a5572c78-a097-45d7-b476-ed4876889dea
2421
caps.latest.revision: 20
@@ -41,53 +38,78 @@ translation.priority.mt:
4138
- "zh-tw"
4239
---
4340
# add_cv Class
44-
Makes const/volatile type from type.
41+
Makes const volatile type from type.
4542

4643
## Syntax
4744

4845
```
49-
template <class Ty>
46+
template <class T>
5047
struct add_cv;
5148
52-
template <class T>using add_cv_t = typename add_cv<T>::type;
49+
template <class T>
50+
using add_cv_t = typename add_cv<T>::type;
5351
```
5452

5553
#### Parameters
56-
`Ty`
57-
The type to modify.
54+
*T*
55+
The type to modify.
5856

5957
## Remarks
60-
An instance of the type modifier holds the modified-type [add_volatile Class](../standard-library/add-volatile-class.md)`<` [add_const Class](../standard-library/add-const-class.md)`<Ty> >`.
58+
An instance of the modified type `add_cv<T>` has a `type` member typedef equivalent to *T* modified by both [add_volatile](../standard-library/add-volatile-class.md) and [add_const](../standard-library/add-const-class.md), unless *T* already has the cv-qualifiers, is a reference, or is a function.
59+
60+
The `add_cv_t<T>` helper type is a shortcut to access the `add_cv<T>` member typedef `type`.
6161

6262
## Example
6363

6464
```cpp
65+
// add_cv.cpp
66+
// compile by using: cl /EHsc /W4 add_cv.cpp
6567
#include <type_traits>
6668
#include <iostream>
67-
68-
int main()
69-
{
70-
std::add_cv_t<int> *p = (const volatile int *)0;
71-
72-
p = p; // to quiet "unused" warning
73-
std::cout << "add_cv<int> == "
74-
<< typeid(*p).name() << std::endl;
75-
76-
return (0);
77-
}
78-
69+
70+
struct S {
71+
void f() {
72+
std::cout << "invoked non-cv-qualified S.f()" << std::endl;
73+
}
74+
void f() const {
75+
std::cout << "invoked const S.f()" << std::endl;
76+
}
77+
void f() volatile {
78+
std::cout << "invoked volatile S.f()" << std::endl;
79+
}
80+
void f() const volatile {
81+
std::cout << "invoked const volatile S.f()" << std::endl;
82+
}
83+
};
84+
85+
template <class T>
86+
void invoke() {
87+
T t;
88+
((T *)&t)->f();
89+
}
90+
91+
int main()
92+
{
93+
invoke<S>();
94+
invoke<std::add_const<S>::type>();
95+
invoke<std::add_volatile<S>::type>();
96+
invoke<std::add_cv<S>::type>();
97+
}
7998
```
8099
81100
```Output
82-
add_cv_t<int> == int
101+
invoked non-cv-qualified S.f()
102+
invoked const S.f()
103+
invoked volatile S.f()
104+
invoked const volatile S.f()
83105
```
84106

85107
## Requirements
86-
**Header:** <type_traits>
108+
**Header:** <type_traits>
87109

88-
**Namespace:** std
110+
**Namespace:** std
89111

90112
## See Also
91-
[<type_traits>](../standard-library/type-traits.md)
92-
[remove_const Class](../standard-library/remove-const-class.md)
93-
[remove_volatile Class](../standard-library/remove-volatile-class.md)
113+
[<type_traits>](../standard-library/type-traits.md)
114+
[remove_const Class](../standard-library/remove-const-class.md)
115+
[remove_volatile Class](../standard-library/remove-volatile-class.md)

docs/standard-library/add-pointer-class.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ f1_keywords:
1212
- "add_pointer"
1313
- "std::add_pointer"
1414
- "type_traits/std::add_pointer"
15-
- "std.add_pointer"
16-
- "std.tr1.add_pointer"
17-
- "tr1::add_pointer"
18-
- "std::tr1::add_pointer"
19-
- "type_traits/std::tr1::add_pointer"
2015
dev_langs:
2116
- "C++"
2217
helpviewer_keywords:
23-
- "add_pointer class [TR1]"
18+
- "add_pointer class"
2419
- "add_pointer"
2520
ms.assetid: d8095cb0-6578-4143-b78f-87f82485298c
2621
caps.latest.revision: 22
@@ -48,39 +43,39 @@ Makes a pointer-to-type from a specified type.
4843
## Syntax
4944

5045
```
51-
template <class Ty>
46+
template <class T>
5247
struct add_pointer;
5348
54-
template <class T>using add_pointer_t = typename add_pointer<T>::type;
49+
template <class T>
50+
using add_pointer_t = typename add_pointer<T>::type;
5551
```
5652

5753
#### Parameters
58-
`Ty`
59-
The type to modify.
54+
*T*
55+
The type to modify.
6056

6157
## Remarks
62-
The member typedef type names the same type as `remove_reference<T>::type*`.
58+
The member typedef `type` names the same type as `remove_reference<T>::type*`. The alias `add_pointer_t` is a shortcut to access the member typedef `type`.
6359

64-
Because it is invalid to make a pointer from a reference, `add_pointer` removes the reference, if any, from the specified type before it makes a pointer-to-type. Consequently, you can use a type with `add_pointer` without being concerned about whether the type is a reference.
60+
Because it is invalid to make a pointer from a reference, `add_pointer` removes the reference, if any, from the specified type before it makes a pointer-to-type. Consequently, you can use a type with `add_pointer` without being concerned about whether the type is a reference.
6561

6662
## Example
67-
The following example demonstrates that `add_pointer` of a type is the same as a pointer to that type.
63+
The following example demonstrates that `add_pointer` of a type is the same as a pointer to that type.
6864

69-
```
65+
```cpp
7066
#include <type_traits>
7167
#include <iostream>
7268

7369
int main()
74-
{
70+
{
7571
std::add_pointer_t<int> *p = (int **)0;
7672

7773
p = p; // to quiet "unused" warning
7874
std::cout << "add_pointer_t<int> == "
7975
<< typeid(*p).name() << std::endl;
8076

8177
return (0);
82-
}
83-
78+
}
8479
```
8580

8681
```Output

docs/standard-library/add-volatile-class.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ f1_keywords:
1212
- "add_volatile"
1313
- "std::add_volatile"
1414
- "type_traits/std::add_volatile"
15-
- "std.add_volatile"
16-
- "std.tr1.add_volatile"
17-
- "tr1::add_volatile"
18-
- "std::tr1::add_volatile"
19-
- "type_traits/std::tr1::add_volatile"
2015
dev_langs:
2116
- "C++"
2217
helpviewer_keywords:
23-
- "add_volatile class [TR1]"
18+
- "add_volatile class"
2419
- "add_volatile"
2520
ms.assetid: cde57277-d764-402d-841e-97611ebaab14
2621
caps.latest.revision: 21
@@ -43,23 +38,24 @@ translation.priority.mt:
4338
- "zh-tw"
4439
---
4540
# add_volatile Class
46-
Makes volatile type from the specified type.
41+
Makes a volatile type from the specified type.
4742

4843
## Syntax
4944

5045
```
5146
template <class Ty>
5247
struct add_volatile;
5348
54-
template <class T>using add_volatile_t = typename add_volatile<T>::type;
49+
template <class T>
50+
using add_volatile_t = typename add_volatile<T>::type;
5551
```
5652

57-
#### Parameters
58-
`Ty`
59-
The type to modify.
53+
### Parameters
54+
*T*
55+
The type to modify.
6056

6157
## Remarks
62-
An instance of the type modifier holds a modified-type that is `Ty` if `Ty` is a reference, a function, or a volatile-qualified type, otherwise `volatile Ty`.
58+
An instance of `add_volatile<T>` has a member typedef `type` that is *T* if *T* is a reference, a function, or a volatile-qualified type, otherwise `volatile` *T*. The alias `add_volatile_t` is a shortcut to access the member typedef `type`.
6359

6460
## Example
6561

@@ -68,27 +64,26 @@ template <class T>using add_volatile_t = typename add_volatile<T>::type;
6864
#include <iostream>
6965

7066
int main()
71-
{
67+
{
7268
std::add_volatile_t<int> *p = (volatile int *)0;
7369

7470
p = p; // to quiet "unused" warning
7571
std::cout << "add_volatile<int> == "
7672
<< typeid(*p).name() << std::endl;
7773

7874
return (0);
79-
}
80-
75+
}
8176
```
8277

8378
```Output
8479
add_volatile<int> == int
8580
```
8681

8782
## Requirements
88-
**Header:** <type_traits>
83+
**Header:** <type_traits>
8984

90-
**Namespace:** std
85+
**Namespace:** std
9186

9287
## See Also
93-
[<type_traits>](../standard-library/type-traits.md)
94-
[remove_volatile Class](../standard-library/remove-volatile-class.md)
88+
[<type_traits>](../standard-library/type-traits.md)
89+
[remove_volatile Class](../standard-library/remove-volatile-class.md)

docs/standard-library/aligned-storage-class.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ f1_keywords:
1212
- "aligned_storage"
1313
- "std::aligned_storage"
1414
- "type_traits/std::aligned_storage"
15-
- "std.aligned_storage"
16-
- "std.tr1.aligned_storage"
17-
- "tr1::aligned_storage"
18-
- "std::tr1::aligned_storage"
19-
- "type_traits/std::tr1::aligned_storage"
2015
dev_langs:
2116
- "C++"
2217
helpviewer_keywords:
23-
- "aligned_storage class [TR1]"
18+
- "aligned_storage class"
2419
- "aligned_storage"
2520
ms.assetid: f255e345-1f05-4d07-81e4-017f420839fb
2621
caps.latest.revision: 23

docs/standard-library/alignment-of-class.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ f1_keywords:
1212
- "alignment_of"
1313
- "std::alignment_of"
1414
- "type_traits/std::alignment_of"
15-
- "std.alignment_of"
16-
- "std.tr1.alignment_of"
17-
- "tr1::alignment_of"
18-
- "std::tr1::alignment_of"
19-
- "type_traits/std::tr1::alignment_of"
2015
dev_langs:
2116
- "C++"
2217
helpviewer_keywords:
23-
- "alignment_of class [TR1]"
18+
- "alignment_of class"
2419
- "alignment_of"
2520
ms.assetid: 4141c59a-f94e-41c4-93fd-9ea578b27387
2621
caps.latest.revision: 22

0 commit comments

Comments
 (0)