Skip to content

Commit b9b1d22

Browse files
committed
fix order of template arguments to fix overload resolution
1 parent 9c65d14 commit b9b1d22

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

changes.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Changes
22
=======
33

4-
0.9.1
4+
0.9.3
5+
* fix overload resolution problem for casts
6+
7+
0.9.2
58
* do not define quantities per retag or rescale to prevent overloading failing due to non-deducable contexts
69

710
0.9.1

quantity.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ constexpr auto operator%(const V1& lhs, const quantity<U2,S2,V2,T2>& rhs) {
616616
* seconds<std::int16_t> value = value_cast (1_s); // OK
617617
*
618618
*/
619-
template<typename V, typename U, typename S, typename T>
619+
template<typename U, typename S, typename V, typename T>
620620
constexpr auto value_cast(const quantity<U,S,V,T>& q) {return implicit_quantity_caster<U,S,V,T,true,false,false>{q};}
621621
template<typename NewValueType, typename U, typename S, typename T, typename V>
622622
constexpr auto value_cast(const quantity<U,S,V,T>& q) {return quantity<U,S,NewValueType,T>{value_cast(q)};}
@@ -645,7 +645,7 @@ constexpr auto value_cast(const quantity<U,S,V,T>& q) {retur
645645
* seconds<unsigned long long> value = scale_cast<second_scaling>(1_h); // OK
646646
* seconds<unsigned long long> value = scale_cast (1_h); // OK
647647
*/
648-
template<typename S, typename U, typename V, typename T>
648+
template<typename U, typename S, typename V, typename T>
649649
constexpr auto scale_cast(const quantity<U,S,V,T>& q) {return implicit_quantity_caster<U,S,V,T,false,true,false>{q};}
650650
template<typename NewScale, typename U, typename S, typename V, typename T>
651651
constexpr auto scale_cast(const quantity<U,S,V,T>& q) {return quantity<U,NewScale,V,T>{scale_cast(q)};}

0 commit comments

Comments
 (0)