From Jason Turner

[meta.trans.other]

Diff to HTML by rtfpessoa

tmp/tmptwfxs9ez/{from.md → to.md} RENAMED
@@ -19,21 +19,21 @@ The nested typedef `common_type::type` shall be defined as follows:
19
  ``` cpp
20
  template <class ...T> struct common_type;
21
 
22
  template <class T>
23
  struct common_type<T> {
24
- typedef T type;
25
  };
26
 
27
  template <class T, class U>
28
  struct common_type<T, U> {
29
- typedef decltype(true ? declval<T>() : declval<U>()) type;
30
  };
31
 
32
  template <class T, class U, class... V>
33
  struct common_type<T, U, V...> {
34
- typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
35
  };
36
  ```
37
 
38
  Given these definitions:
39
 
@@ -53,13 +53,13 @@ typedef char S::*PMD;
53
  ```
54
 
55
  the following assertions will hold:
56
 
57
  ``` cpp
58
- static_assert(is_same<result_of<S(int)>::type, short>::value, "Error!");
59
- static_assert(is_same<result_of<S&(unsigned char, int&)>::type, double>::value, "Error!");
60
- static_assert(is_same<result_of<PF1()>::type, bool>::value, "Error!");
61
- static_assert(is_same<result_of<PMF(unique_ptr<S>, int)>::type, void>::value, "Error!");
62
- static_assert(is_same<result_of<PMD(S)>::type, char&&>::value, "Error!");
63
- static_assert(is_same<result_of<PMD(const S*)>::type, const char&>::value, "Error!");
64
  ```
65
 
 
19
  ``` cpp
20
  template <class ...T> struct common_type;
21
 
22
  template <class T>
23
  struct common_type<T> {
24
+ typedef decay_t<T> type;
25
  };
26
 
27
  template <class T, class U>
28
  struct common_type<T, U> {
29
+ typedef decay_t<decltype(true ? declval<T>() : declval<U>())> type;
30
  };
31
 
32
  template <class T, class U, class... V>
33
  struct common_type<T, U, V...> {
34
+ typedef common_type_t<common_type_t<T, U>, V...> type;
35
  };
36
  ```
37
 
38
  Given these definitions:
39
 
 
53
  ```
54
 
55
  the following assertions will hold:
56
 
57
  ``` cpp
58
+ static_assert(is_same<result_of_t<S(int)>, short>::value, "Error!");
59
+ static_assert(is_same<result_of_t<S&(unsigned char, int&)>, double>::value, "Error!");
60
+ static_assert(is_same<result_of_t<PF1()>, bool>::value, "Error!");
61
+ static_assert(is_same<result_of_t<PMF(unique_ptr<S>, int)>, void>::value, "Error!");
62
+ static_assert(is_same<result_of_t<PMD(S)>, char&&>::value, "Error!");
63
+ static_assert(is_same<result_of_t<PMD(const S*)>, const char&>::value, "Error!");
64
  ```
65