Scalar constraint added to quantity constructor
This commit is contained in:
1 parent
4ba818bb78
commit
458ac0918b
1 file changed
+3
-2
@@ -191,8 +191,9 @@ namespace units {
|
||||
quantity() = default;
|
||||
quantity(const quantity&) = default;
|
||||
|
||||
template<std::convertible_to<rep> Rep2>
|
||||
requires treat_as_floating_point<rep> || (!treat_as_floating_point<Rep2>)
|
||||
template<Scalar Rep2>
|
||||
requires std::convertible_to<Rep2, rep> &&
|
||||
(treat_as_floating_point<rep> || (!treat_as_floating_point<Rep2>))
|
||||
constexpr explicit quantity(const Rep2& r) : value_{static_cast<rep>(r)}
|
||||
{
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user