feat: point_from extended with the case of the same origin

This commit is contained in:
Mateusz Pusz committed 2023-08-02 11:20:32 +02:00
1 parent c289bbcfdb
commit ccdf5d319a
2 files changed
+9 -1

No files matched your search

+3 -1
View File
@@ -142,7 +142,9 @@ public:
template<PointOriginFor<quantity_spec> NewPO>
[[nodiscard]] constexpr QuantityPointOf<NewPO{}> auto point_from(NewPO origin) const
{
if constexpr (detail::is_derived_from_specialization_of_relative_point_origin<NewPO>) {
if constexpr (std::is_same_v<NewPO, std::remove_const_t<decltype(point_origin)>>) {
return *this;
} else if constexpr (detail::is_derived_from_specialization_of_relative_point_origin<NewPO>) {
auto q = absolute() - origin.quantity_point.absolute();
return quantity_point<reference, NewPO{}, typename decltype(q)::rep>(std::move(q));
} else {