@@ -60,31 +60,24 @@ namespace stdsharp
60
60
}
61
61
62
62
public:
63
- template <typename Self, typename SelfT = const Self>
64
- [[nodiscard]] constexpr auto read_with (this const Self&& self, auto &&... args)
65
- requires requires {
66
- forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>(
67
- cpp_forward (args)...
68
- );
69
- }
70
- {
71
- return forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>(
72
- cpp_forward (args)...
73
- );
74
- }
75
-
76
- template <typename Self, typename SelfT = const Self&>
77
- [[nodiscard]] constexpr auto read_with (this const Self& self, auto &&... args)
78
- requires requires {
79
- forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>(
80
- cpp_forward (args)...
81
- );
82
- }
83
- {
84
- return forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>(
85
- cpp_forward (args)...
86
- );
87
- }
63
+ #define STDSHARP_SYNCHRONIZER_READ_WITH (ref ) \
64
+ template <typename Self, typename SelfT = const Self ref> \
65
+ [[nodiscard]] constexpr auto read_with (this const Self ref self, auto &&... args) \
66
+ requires requires { \
67
+ forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>( \
68
+ cpp_forward (args)... \
69
+ ); \
70
+ } \
71
+ { \
72
+ return forward_cast<SelfT, synchronizer>(self).template write_impl <shared_lock>( \
73
+ cpp_forward (args)... \
74
+ ); \
75
+ }
76
+
77
+ STDSHARP_SYNCHRONIZER_READ_WITH (&)
78
+ STDSHARP_SYNCHRONIZER_READ_WITH (&&)
79
+
80
+ #undef STDSHARP_SYNCHRONIZER_READ_WITH
88
81
89
82
template <typename Self, typename SelfT = const Self&>
90
83
[[nodiscard]] constexpr auto write_with (this Self&& self, auto &&... args)
0 commit comments