We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
as_lvalue
1 parent ce896e5 commit 7e1ddc6Copy full SHA for 7e1ddc6
test/test_utils.hpp
@@ -130,8 +130,8 @@ constexpr void has_type(Actual &&)
130
static_assert(std::is_same<Expected, Actual>::value, "Not the same");
131
}
132
133
-template<ranges::cardinality Expected,
134
- typename Rng,
+template<ranges::cardinality Expected,
+ typename Rng,
135
ranges::cardinality Actual = ranges::range_cardinality<Rng>::value>
136
constexpr void has_cardinality(Rng &&)
137
{
@@ -141,7 +141,7 @@ constexpr void has_cardinality(Rng &&)
141
template<typename T>
142
constexpr T & as_lvalue(T && t)
143
144
- return *&t; // prevent C++23 implicit move
+ return static_cast<T&>(t); // prevent C++23 implicit move (plain `t` is move-eligible)
145
146
147
// A simple, light-weight, non-owning reference to a type-erased function.
0 commit comments