File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ namespace stdsharp
28
28
};
29
29
30
30
template <typename T>
31
- class default_arithmetic_operation : default_increase_and_decrease<T>
31
+ class default_arithmetic_operator : default_increase_and_decrease<T>
32
32
{
33
33
friend constexpr T& operator ++(T& t) noexcept (noexcept (t += 1 ))
34
34
requires requires { t += 1 ; }
@@ -72,4 +72,20 @@ namespace stdsharp
72
72
return 0 - t;
73
73
};
74
74
};
75
+
76
+ template <typename T>
77
+ class default_arrow_operator
78
+ {
79
+ [[nodiscard]] constexpr decltype (auto ) operator->() const noexcept (noexcept (*static_cast <const T&>(*this )))
80
+ requires dereferenceable<const T&>
81
+ {
82
+ return *static_cast <const T&>(*this );
83
+ }
84
+
85
+ [[nodiscard]] constexpr decltype (auto ) operator->() noexcept (noexcept (*static_cast <T&>(*this )))
86
+ requires dereferenceable<T&>
87
+ {
88
+ return *static_cast <T&>(*this );
89
+ }
90
+ };
75
91
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace stdsharp::filesystem
14
14
15
15
template <typename Rep, std::uintmax_t Num, std::uintmax_t Denom>
16
16
class space_size <Rep, std::ratio<Num, Denom>> :
17
- default_arithmetic_operation <space_size<Rep, std::ratio<Num, Denom>>>
17
+ default_arithmetic_operator <space_size<Rep, std::ratio<Num, Denom>>>
18
18
{
19
19
public:
20
20
using rep = Rep;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace stdsharp
9
9
{
10
10
template <typename T> // NOLINTBEGIN(*-pointer-arithmetic)
11
11
class launder_iterator :
12
- default_arithmetic_operation <launder_iterator<T>>,
12
+ default_arithmetic_operator <launder_iterator<T>>,
13
13
public std::random_access_iterator_tag
14
14
{
15
15
T* ptr_;
You can’t perform that action at this time.
0 commit comments