Attempt to satisfy MSVC 14

```
test\unit_test\runtime\magnitude_test.cpp(143): error C2672:
'units::check_same_type_and_value': no matching overloaded function
found
```

Maybe it's confused by accessing the static member variable template
using dot-notation on an _instance_?  If so, let's see how it likes the
member-function syntax.
This commit is contained in:
Chip Hogg
2022-01-28 22:42:23 +00:00
parent 811b6ba53d
commit d6eb25f07a
2 changed files with 23 additions and 18 deletions
+5
View File
@@ -339,6 +339,11 @@ struct magnitude {
requires (std::is_floating_point_v<T> || (detail::is_integral(BPs) && ...))
static constexpr T value = detail::checked_static_cast<T>(
(detail::compute_base_power<T>(BPs) * ...));
// Trying to satisfy MSVC 14...
template<typename T>
requires (std::is_floating_point_v<T> || (detail::is_integral(BPs) && ...))
constexpr T get_value() const { return magnitude::value<T>; }
};
// Implementation for Magnitude concept (below).