From Jason Turner

[refwrap.common.ref]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5tso8u0x/{from.md → to.md} +32 -0
tmp/tmp5tso8u0x/{from.md → to.md} RENAMED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### `common_reference` related specializations <a id="refwrap.common.ref">[[refwrap.common.ref]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class T>
6
+ constexpr bool is-ref-wrapper = false; // exposition only
7
+
8
+ template<class T>
9
+ constexpr bool is-ref-wrapper<reference_wrapper<T>> = true;
10
+
11
+ template<class R, class T, class RQ, class TQ>
12
+ concept ref-wrap-common-reference-exists-with = // exposition only
13
+ is-ref-wrapper<R> &&
14
+ requires { typename common_reference_t<typename R::type&, TQ>; } &&
15
+ convertible_to<RQ, common_reference_t<typename R::type&, TQ>>;
16
+
17
+ template<class R, class T, template<class> class RQual, template<class> class TQual>
18
+ requires (ref-wrap-common-reference-exists-with<R, T, RQual<R>, TQual<T>> &&
19
+ !ref-wrap-common-reference-exists-with<T, R, TQual<T>, RQual<R>>)
20
+ struct basic_common_reference<R, T, RQual, TQual> {
21
+ using type = common_reference_t<typename R::type&, TQual<T>>;
22
+ };
23
+
24
+ template<class T, class R, template<class> class TQual, template<class> class RQual>
25
+ requires (ref-wrap-common-reference-exists-with<R, T, RQual<R>, TQual<T>> &&
26
+ !ref-wrap-common-reference-exists-with<T, R, TQual<T>, RQual<R>>)
27
+ struct basic_common_reference<T, R, TQual, RQual> {
28
+ using type = common_reference_t<typename R::type&, TQual<T>>;
29
+ };
30
+ }
31
+ ```
32
+