refactor: reference::operator() return type constraints improved

This commit is contained in:
Mateusz Pusz
2022-12-22 21:28:49 +01:00
parent e61bfafd29
commit 0caf998df1

View File

@@ -53,7 +53,7 @@ struct reference {
template<RepresentationOf<Q.character> Rep>
// TODO can we somehow return an explicit quantity type here?
[[nodiscard]] constexpr Quantity auto operator()(Rep&& value) const
[[nodiscard]] constexpr std::same_as<quantity<reference{}, Rep>> auto operator()(Rep&& value) const
{
return quantity<reference{}, Rep>(std::forward<Rep>(value));
}