From Jason Turner

[pointer.traits.types]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpua4o0epv/{from.md → to.md} +35 -5
tmp/tmpua4o0epv/{from.md → to.md} RENAMED
@@ -1,16 +1,46 @@
1
  #### Member types <a id="pointer.traits.types">[[pointer.traits.types]]</a>
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ``` cpp
4
  using element_type = see below;
5
  ```
6
 
7
- *Type:* `Ptr::element_type` if the *qualified-id* `Ptr::element_type` is
8
- valid and denotes a type [[temp.deduct]]; otherwise, `T` if `Ptr` is a
9
- class template instantiation of the form `SomePointer<T, Args>`, where
10
- `Args` is zero or more type arguments; otherwise, the specialization is
11
- ill-formed.
12
 
13
  ``` cpp
14
  using difference_type = see below;
15
  ```
16
 
 
1
  #### Member types <a id="pointer.traits.types">[[pointer.traits.types]]</a>
2
 
3
+ The definitions in this subclause make use of the following
4
+ exposition-only class template and concept:
5
+
6
+ ``` cpp
7
+ template<class T>
8
+ struct ptr-traits-elem // exposition only
9
+ { };
10
+
11
+ template<class T> requires requires { typename T::element_type; }
12
+ struct ptr-traits-elem<T>
13
+ { using type = typename T::element_type; };
14
+
15
+ template<template<class...> class SomePointer, class T, class... Args>
16
+ requires (!requires { typename SomePointer<T, Args...>::element_type; })
17
+ struct ptr-traits-elem<SomePointer<T, Args...>>
18
+ { using type = T; };
19
+
20
+ template<class Ptr>
21
+ concept has-elem-type = // exposition only
22
+ requires { typename ptr-traits-elem<Ptr>::type; }
23
+ ```
24
+
25
+ If `Ptr` satisfies `has-elem-type`, a specialization
26
+ `pointer_traits<Ptr>` generated from the `pointer_traits` primary
27
+ template has the following members as well as those described in 
28
+ [[pointer.traits.functions]]; otherwise, such a specialization has no
29
+ members by any of those names.
30
+
31
+ ``` cpp
32
+ using pointer = see below;
33
+ ```
34
+
35
+ *Type:* `Ptr`.
36
+
37
  ``` cpp
38
  using element_type = see below;
39
  ```
40
 
41
+ *Type:* `typename `*`ptr-traits-elem`*`<Ptr>::type`.
 
 
 
 
42
 
43
  ``` cpp
44
  using difference_type = see below;
45
  ```
46